0.雅虎css初始化
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { margin:0; padding:0; }
body { background:#fff; color:#555; font-size:14px; font-family: Verdana, Arial, Helvetica, sans-serif; }
td,th,caption { font-size:14px; }
h1, h2, h3, h4, h5, h6 { font-weight:normal; font-size:100%; }
address, caption, cite, code, dfn, em, strong, th, var { font-style:normal; font-weight:normal;}
a { color:#555; text-decoration:none; }
a:hover { text-decoration:underline; }
img { border:none; }
ol,ul,li { list-style:none; }
input, textarea, select, button { font:14px Verdana,Helvetica,Arial,sans-serif; }
table { border-collapse:collapse; }
html {overflow-y: scroll;}
.clearfix:after {content: "."; display: block; height:0; clear:both; visibility: hidden;}
.clearfix { *zoom:1; }
1.居中
margin-left:auto;
margin-right:auto;
2.锚点
<a name="亲子时光">亲子时光</a>
<a name="户外出行">户外出行</a>
<a name="打造爱巢">打造爱巢</a>
<a href="tianmao.aspx#亲子时光">亲子时光</a>
<a href="tianmao.aspx#户外出行">户外出行</a>
<a href="tianmao.aspx#打造爱巢">打造爱巢</a>
3.内联框架
<a href="http://www.souhu.com" target="myframe">第二页</a>
<iframe src="http://www.baidu.com" width="500" height="500" name="myframe"></iframe>
4.<img src="图片地址" alt="图片下载失败时显示的文章" title="鼠标滑过时显示的文本" />
5.图片透明度
img{ opacity:0.4; filter:alpha(opacity=40); /* 针对 IE8 以及更早的版本 */ } img:hover{ opacity:1.0; filter:alpha(opacity=100); /* 针对 IE8 以及更早的版本 */ }
6.图片的变大变小
<style>
img.big {height: 160px}
img.small {height: 30px}
</style>
<img class="normal" src="/i/eg_smile.gif" /><br />
<img class="big" src="/i/eg_smile.gif" /><br />
<img class="small" src="/i/eg_smile.gif" />