• 2022-06-12
    判断以下代码中如何设置div1的样式,可以使div1相对于浏览器,(相对于以前位置右上角)向左移动100px,向下移动50px。[style type="text/css"]*{ margin:0; padding:0;}.div1{ width:200px; height:200px; border:2px red solid; }[/][body][div class="div1"] [/]
    A: position:absolute; right:100px; top:50px;
    B: position:absolute; left:100px; top:50px;
    C: position:relative; right:100px; top:50px;
    D: position:relative; left:100px; top:50px;
  • A

    举一反三

    内容

    • 0

      设置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;

    • 1

      判断以下代码中如何设置div1的样式,可以使div1相对于浏览器,(相对于以前位置右上角)向左移动100px,向下移动50px。

    • 2

      在以下代码片段中,属于绝对定位的是() A: #box {width:100px;height:50px;position:absolute;} B: #box (width:100px;height:50px;position:relative;} C: #box {width:100px;height:50px;position:static;} D: #box {width:100px;height:50px;}

    • 3

      ​在以下代码片段中,属于绝对定位的是()。‏ A: box {width:100px;height:50px;} B: box {width:100px;height:50px;position:absolute;} C: box {width:100px;height:50px;position:static;} D: box (width:100px;height:50px;position:relative;}

    • 4

      ​在以下代码片段中,属于绝对定位的是()。‏ A: box {width:100px;height:50px;} B: box {width:100px;height:50px;position:absolute;} C: box {width:100px;height:50px;position:static;} D: box (width:100px;height:50px;position:relative;}