<p>body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div{<br />
margin:0;padding:0;border:0;<br />
}<br />
/*灵活地运用h2等标题的应用,但一定要margin:0;否侧会产生空白*/<br />
body{<br />
background:#fff;color:#333;font-size:12px; margin-top:5px;font-family:"宋体";<br />
}<br />
ul,ol{<br />
list-style-type:none;<br />
}<br />
select,input,img,select{vertical-align:middle;}/*目的在于表单中提交按钮和文字域和文字在同一水平线,否则当提交按钮为图片是不在同一水平线上*/<br />
a{text-decoration:underline;}<br />
a:link{color:#009;}<br />
a:visited{color:#800080;}<br />
a:hover,a:active,a:focus{color:#c00;}<br />
.clearit{clear:both;}<br />
/*去掉链接虚框*/<br />
:focus { outline: none; }/*针对Firfox*/<br />
a,area { blr:expression(this.onFocus=this.blur()) }/*/针对IE*/<br />
/* page */<br />
#page{width:950px; overflow: visible; _display:inline-block; margin:0 auto;}/*overflow: visible;表示显示,hidden表示隐藏,这是新浪网的*/<br />
#container { width:950px; text-align:center; margin:0 auto;}/*这是凤凰网的*/<br />
/*================================== 常用链接 begin=============================== */<br />
a.linkRed:link,a.linkRed:visited{color:#f00!important; color:#0000FF;}/* 红色 */<br />
a.linkRed:hover{color:#c00!important;}<br />
a.linkBlack:link,a.linkBlack:visited{color:#000!important;}/* 黑色 */<br />
a.linkBlack:hover{color:#f00!important;}<br />
a.linkWhite:link,a.linkWhite:visited{color:#fff!important;}/* 白色 */<br />
a.linkWhite:hover{color:#f00!important;}<br />
a.linkGray:link,a.linkGray:visited{color:#5d5d5d!important;}/* 灰色 */<br />
a.linkGray:hover{color:#f00!important;}<br />
a.linkCyan:link,a.linkCyan:visited{color:#92e4fa!important;text-decoration:underline;}/* 青色 */<br />
/*===========================解决段落间距和段落首行缩进==================================*/<br />
p{<br />
text-indent:2em;/*空2个字的距离,em是以当前字号大小为单位*/<br />
margin:0px;<br />
padding:0px;<br />
margin-bottom:15px;<br />
}/*注意一定要加上margin和padding都为0,否则不起作用*/<br />
/*=======================================新闻列表实现=================================*/<br />
.news_list ul li span{<br />
float: right;/*使span元素浮动到右面*/<br />
text-align: right;/*日期右对齐*/<br />
}<br />
/*内容超长时用省略号代替*/<br />
#new1{<br />
width:200px;<br />
overflow:hidden;/*超过宽度不显示*/<br />
text-overflow:ellipsis;/*内容超长时用省略号代替*/<br />
white-space:nowrap;/*强制内容在一行显示*/<br />
border:1px #f00 double;<br />
}<br />
<br />
form{<br />
margin:0;padding:0;/*解决表单下面空行或有空间的问题*/<br />
}<br />
/*=================================解决新闻列表默认空两格和项目符号不显示的问题==============================*/<br />
ul{margin:0;padding:0;list-type:square inside;}/*square表示实心方块,disc表示实心圆即默认值,注意:inside表示项目符号在在文本内,默认是在outside在文本外,即在ul的外边,这样将不会显示列表符号,因为:margin我们设为0了;list-tyle-type:项目符号类型(disc实心圆,circle空心圆,square实心方块,none无;list-style-position:位置(outside和inside;)*/<br />
<br />
/*===============无图片圆角矩形的实现方法(局限于单色)======================*/<br />
/*开始定义*/<br />
#layout{width:300px;height:200px;background: #9BD1FA;/*矩形内部色*/}<br />
.rtop, .rbottom{}<br />
.rtop div, .rbottom div{display:block;height: 1px;overflow: hidden; background: #9BD1FA}/*块rtop,rbottom内的元素高度都为1px,超出隐藏*/<br />
.r1{margin: 0 5px}<br />
.r2{margin: 0 3px} /*注意边距为5px,3px,2px,1px,r4高度为2px,目的为是呈现平滑的圆角效果*/<br />
.r3{margin: 0 2px}<br />
.r4{margin: 0 1px;height: 2px}<br />
.middle{border:1px #9bd1fa solid;boackground:#f00;}/*设置里面边框和背景色*/<br />
/*应用样式*/<br />
/*==========</p>
<div id="lyaout">
<div class="rtop">
<div class="r1"></div>
<div class="r2"></div>
<div class="r3"></div>
<div class="r4"></div>
</div>
<div class="middle">
<p>这是您要放的内容!</p>
</div>
<div class="rtop">
<div class="r4"></div>
<div class="r3"></div>
<div class="r2"></div>
<div class="r1"></div>
</div>
</div>
<p></p>
<p><br />
==============*/<br />
<br />
/*====================================浏览器兼容解决方案======================================================*/<br />
<!--[if ie 6.0]><br />
<link rel="stylesheet" href="ie6.css" type="text/css" media="all" /><br />
<![endif]--><br />
<!--[if ie 7.0]><br />
<link rel="stylesheet" href="ie7.css" type="text/css" media="all" /><br />
<![endif]--><br />
在调用样式表时加上上述语句可根据不同的浏览器调用不同的样式表<br />
<br />
/* Clear Fix */<br />
.clearfix:after {<br />
content:“.”;<br />
display:block;<br />
height:0;<br />
clear:both;<br />
visibility:hidden;<br />
}<br />
.clearfix {<br />
display:inline-block;<br />
}<br />
/* Hide from IE Mac */<br />
.clearfix {display:block;}<br />
/* End hide from IE Mac */<br />
/* end of clearfix */<br />
body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div{margin:0;padding:0;border:0;}<br />
/*可解块浏览的兼容问题*/<br />
body{background:#fff;color:#333;font-size:12px; margin-top:5px;font-family:"宋体"; text-align:center;}<br />
/*在body中加入text-algin:center在火狐中并不能使内容整体居中,所以在层上加上marign:0 auto;*/<br />
ul,ol{list-style-type:none;}<br />
#line{<br />
width:800px;<br />
height:8px;<br />
background:#f00; /* for firefox */<br />
<br />
*background:#0f0; /* for IE6 */<br />
_background:#00f; /*FOR IE7.0,7。0不支支下划线*/<br />
overflow:hidden;/*在ie6.0中,高度小于10px时会出现问题,比实际的要高,所以要加上此句,或者将字体设同高度一样的值,font-size:8px;*/<br />
}<br />
#width{<br />
width: 500px!important; /* 只对IE7+FF有效 */<br />
width:300px;<br />
border:1px double #0ff;<br />
height:100px;<br />
background:#ff0;<br />
}<br />
#f_l{<br />
width:180px;<br />
border:1px double #0ff;<br />
height:50px;<br />
float:right; margin-right:20px;/*在有浮动的时候在ie6.0是居右并非20px,而是40px,即加倍问题,解块办法加上display:inline */<br />
display:inline ;<br />
}<br />
#nav{/*ff有效*/<br />
height:100px;<br />
width:800px;<br />
background:#0ff;<br />
line-height:100px;<br />
vertical-align: middle;<br />
}<br />
*html #nav{/*只对ie有效*/<br />
height:100px;<br />
width:800px;<br />
background:#0ff;<br />
line-height:100px;<br />
vertical-align: middle;<br />
}<br />
*+html #nav{/*只对ie7.0有效*/<br />
height:300px;<br />
width:800px;<br />
background:#0ff;<br />
line-height:300px;<br />
vertical-align: middle;/*文字垂直居中*/</p>
<p></p>