宋休: w * h
xp下 12px[11 * 11] win7 12px[11 * 12]
雅黑:
win7 12px[12 * 11]
标签样式尽量加给块元素,如<h2><a>,设置a字体尽量设置在h2上
行高设置比字体大
行高与高度:ie6都设,不考虑ie6可不设置高度
ie6/7 不支持给li加hover不支持
清浮动:
...
<div class='clear'></div>
<br clear='all' />
.clear{zoom:1}
.clear:after{content:'',display:block;clear:both}
触发bfc css3中 flow root
display:inline-block; table-cell/table-caption 注意:inline-block下面会有空隙,居中也麻烦
float不为None
overflow不为visible
position不为static relative
字体情况下每个数字宽度占字体一半大小
overflow (ie67 zoom:1)
font复合样式包括line-height,如果line-height单独写需放在font后面
小图标统一都是背景
字体14 上8下8,则line-height:14 + 8 + 8 = 30
active 选项卡下边框盖住,active{ padding-bottom:1px } ie6 { padding-bottom:1px;margin-bottom:-1px;overflow:hidden;position:relative; }
margin 负值 {margin-top:20px;}并且把父级高级撑开20px; {margin-top:-20px}少占父级20px,父级少撑开1px,自身大小占用大小不改变;position:relative解决ie6下出去的部分不会被父级截掉
letter-space ie6下会出问题
两border相交时,为梯形,不相交时,为直形
元素浮动之后宽度如果是内容撑开的,就给里边所有块元素,都加浮动 ,否则给元素设置宽度
type=hidden 模擬select radio 把選擇的值覆給hidden,所以可以提交
background-position控制圖片在元素中的位置
input與外層高度一致 + float:left;
<style>
.box{ height: 40px;border:1px solid #000000; font-size: 12px; font-family: '宋体';}
input{ margin: 0; padding: 0;vertical-align: middle}
span{ display: inline-block; height: 40px;vertical-align: middle; line-height: 40px;}
input[type=radio]{ width: 13px; height: 13px;}
select{ width: 300px; background: #0ff; height: 40px;} /* ie6不支持高度设置 */
option{ background: #000; color: #ffffff;}
</style>
<div class="box">
<input type="radio" name="" id=""/><span>邮件</span> <input type="text"/>
</div>