点评:p+CSS 斜线效果很简单,只需设置一下CSS Border 的边框就能有斜线效果,有需要的朋友可以参考下!
复制代码代码如下:
<p id="box"></p></p> <p><style type="text/css">
#box{
width:0px; height:0px;
border:40px solid #000;
border-top-color:#930;
border-bottom-color:#0C3;
border-left-color:#FC0;
border-right-color:#009;
}
</style>
在FF IE7 IE8 都显示正常,但在IE6中,却如上图左边所示,中间有差距,因此,需要加一行:
line-height:0px;
最终代码如下:
复制代码代码如下:
<p id="box"></p>
<style type="text/css">
#box{
width:0px; height:0px;
border:40px solid #000;
border-top-color:#930;
border-bottom-color:#0C3;
border-left-color:#FC0;
border-right-color:#009;
line-height:0px;
}
</style>
</head>