一、 耐心填一填!(每空4分,共24分)
1. 为div设置类a与b,应编写HTML代码
<div class="a b"></div>
- 设置CSS属性clear的值为 _时可清除左右两边浮动。
clear:both;
- __标签必须直接嵌套于ul、ol中。
li
- CSS属性_可为元素设置外补丁。
margin
- 设置CSS属性float的值为_ _时可取消元素的浮动。
float:none
- 文字居中的CSS代码是__。
text-align:center;
二、 精心选一选!(每题4分,共16分)
1. 下列哪个样式定义后,内联(非块状)元素可以定义宽度和高度( C )
A. display:inline B. display:none C. display:block D. display:inheric
- 选出你认为最合理的定义标题的方法( C )
A. <span class=”heading”>文章标题</span>
B. <p><b>文章标题</b></p>
C. <h1>文章标题</h1>
D. <strong>文章标题</strong>
- br标签在XHTML中语义为( A )
A.换行 B.强调 C.段落 D.标题
- 不换行必须设置( AC )
A.word-break B.letter-spacing C.white-space D.word-spacing
- 在使用table表现数据时,有时候表现出来的会比自己实际设置的宽度要宽,为此需要设置下面哪些属性值( AD )
A. cellpadding=”0″ B. padding:0 C. margin:0 D. cellspacing=”0″
三、判断对或错!(每题4分,共24分)
1. CSS属性font-style 用于设置字体的粗细。 ( × )
2. CSS属性overflow用于设置元素超过宽度时是否隐藏或显示滚动条。 ( √ )
3. 在不涉及样式情况下,页面元素的优先显示与结构摆放顺序无关。 ( × )
4. 在不涉及样式情况下,页面元素的优先显示与标签选用无关。 ( √ )
5. display:inline兼容所有的浏览器。 ( √ )
6. input属于窗体元素,层级显示比flash、其它元素都高。 ( × )
四、用心想一想,你一定是生活中的智者! (每题9分,共36分)
- 写出ul、ol、dl三种列表的html结构。
答:
<ul>
<li> </li>
</ul>
<ol>
<li> </li>
</ol>
<dl>
<dt> </dt>
<dd> </dd>
</dl>
复制代码
2. 将以下CSS代码进行缩写,注意要符合缩写的规范。
`a) 代码一:
border-width:1px;
border-color:#000;
border-style:solid;
border:1px solid #000;
b) 代码二:
background-position:0 0;
background-repeat:no-repeat;
background-attachment:fixed;
background-color:#f00;
background-image:url(background.gif);
background: #f00 url(background.gif) no-repeat fixed 0 0 ;
c)代码三:
font-style:italic;
font-family:"Lucida Grande",sans-serif;
font-size:1em;
font-weight:bold;
font-variant:small-caps;
line-height:140%;
font: italic bold small-caps 1em/140% "Lucida Grande",sans-serif
d) 代码四:
list-style-position:inside;
list-style-type:square;
list-style-image:url(image.gif);
list: url(image.gif) square inside;
e)代码五:
margin-left:20px;
margin-right:20px;
margin-bottom:5px;
margin-top:20px;
margin: 20px 20px 5px;
f)代码六
color:#336699;
color:#ffcc00;
color:#369;
color:#fc0;