11.li中内容超过长度后以省略号显示css
此方法适用于IE与OP浏览器 浏览器
<style type="text/css">spa
li { code
width:200px; blog
white-space:nowrap; ip
text-overflow:ellipsis; get
-o-text-overflow:ellipsis; it
overflow: hidden; io
} 容器
</style>
12.为何没法定义1px左右高度的容器
• IE6下这个问题是由于默认的行高形成的,解决的方法也有不少,例如:overflow:hidden | zoom:0.08 | line-height:1px等。
13.怎样使一个div垂直居中于浏览器中?
• 这里咱们使用百分比绝对定位,与外补丁负值的方法,负值的大小为其自身宽度高度除以二 。
<style type="text/css">
div {
position:absolute;
top:50%;
lef:50%;
margin:-100px 0 0 -100px;
width:200px;
height:200px;
border:1px solid red;
}
</style>
14.div居中问题
• div设置 margin-left, margin-right 为 auto 时已经居中,IE 不行,IE须要设定body居中,首先在父级元素定义text-algin: center;这个的意思就是在父级元素内的内容居中。
15.P标签嵌套块元素问题
p标签嵌套div
<p>
<div>div</div>
</p>
必定要遵照块元素嵌套规则!