A:
B: container { margin: 0 auto ; width:780px; }
C:
D: container { position: relative;width:780px; left: 50%; margin-left: -390px; }
E:
F: container { margin: 0 auto ; width: 85%;}
G:
H: container { position: relative;width:780px; right: 50%; margin-left: 390px; }
举一反三
- 为了让以下id为container的div能够水平居中,需要的CSS样式是( )。页面正文 A: #container{width:880px; padding:0px auto;} B: #container{width:880px;padding:auto 0px;} C: #container{width:880px;margin:auto 0px;} D: #container{width:880px;margin:0px auto;}
- 设置DIV宽为500像素和高为400像素的正确方法是? A: height:500 px; width:400 px; B: margin:500px; padding:400 px; C: padding:500 px;margin:400 px; D: width:500 px;height:400 px;
- 结构:|表现:div{width:678px;height:456px;background:#f00}|p{width:234px;height:124px;background:#00f} 以下选项中,可以实现让p在div中水平和垂直居中的代码() A: 给p添加position:absolute;left:0;top:0;bottom:0;right:0;margin:auto 给div添加position:relative B: 给p添加position:absolute;left:50%;top:50%; 给div添加position:relative C: 给p添加position:absolute; left:50%;top:50%;margin-left:117px;margin-top:62px 给div添加position:absolute D: 给p添加position:absolute;left:50%;top:50%;margin-left:-117px;margin-top:-62px 给div添加position:absolute
- In css, to center the box vertically with the center of the page, fill in the blank space (). .box{ position: ; top:0; bottom:0; left:0; right:0; margin: ; width: 300px; height: 200px; border:2px solid #ccc; } A: absolute 50% B: absolute auto C: relative<br/>50% D: relative auto
- 下列哪种CSS属性不能让页面在浏览器中居中显示(网页中所有可显示的元素都包含在一个id为container的div盒子内)。()
内容
- 0
为了让div容器在页面中水平居中,需要的CSS样式是( )。 A: div{width:880px; padding:0px auto;} B: div{width:880px; padding:auto 0px;} C: div{width:880px; margin:auto 0px;} D: div{ width:880px; margin:0px auto;}
- 1
第一个DIV的样式style为width:150px;height:50px;margin:5px 7px 2px 3px;padding:5px;border:1px solid #000;第二个DIV的样式style为width:150px;height:50px;margin:0;padding:0;border:1px solid #000;请问第一个DIV的实际宽度为________px,原点坐标为x=_____px,y=______px;第二个DIV的原点坐标为x=_____px,y=______px原点为盒子模型可见区域的左上角定点
- 2
设置div居中的方法是给div设置一个宽度,然后添加margin:0 auto属性,即div{width:200px; margin:0 auto; }
- 3
让三个DIV元素在一行并排显示的属性正确的是()。 A: position:relative; B: position:fixed C: margin:0auto D: float:left;
- 4
21、对下列代码解析正确的是(_____)。 <style type="text/css"> body{ margin:0 } div{float:left; margin-left:10px; width:200px; height:200px; border:1px solid red } </style>