一些常用的css技巧
1、不用圖片實現(xiàn) Rounded corners
CSS代碼如下:
.rtop, .rbottom{display:block;background:#fff;}
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden;background:#ccc;}
.r1{margin: 0 5px;}
.r2{margin: 0 3px;}
.r3{margin: 0 2px;}
.r4{margin: 0 1px; height: 2px;}
#withoutPic{
width: 500px;
background:#ccc;
color:#fff;
margin:0 15px;
}
在BODY中加入:
<div id=withoutPic>
<b class="rtop">
<b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b>
</b>
<p>This is a example of "不用圖片實現(xiàn) Rounded corners " by kissjava !!!</p>
<b class="rbottom">
<b class="r4"></b> <b class="r3"></b> <b class="r2"></b><b class="r1"></b>
</b>
</div>
效果為:

2、用圖片實現(xiàn) Rounded corners
CSS代碼如下:
.withPic { width: 300px; background: #fbeac3; border: 1px solid #534515; position: relative; margin: 10px 0;}
.withPic .tl{ position: absolute; width: 14px; height: 14px; background: url(images/box-two-tl.png); top: -1px; left: -1px; }
.withPic .tr{ width: 14px; height: 14px; background: url(images/box-two-tr.png); position: absolute; top: -1px; right: -1px; }
.withPic .bl{ width: 14px; height: 14px; background: url(images/box-two-bl.png); position: absolute; bottom: -1px; left: -1px; }
.withPic .br{ width: 14px; height: 14px; background: url(images/box-two-br.png); position: absolute; bottom: -1px; right: -1px; }
.withPic .inside{ padding: 10px; }
CSS代碼如下:






















效果為:

2、用圖片實現(xiàn) Rounded corners
CSS代碼如下:







在BODY中加入:









效果為:
3、Blockquote標(biāo)簽使用
CSS代碼如下:















在BODY中加入:








4、From 表單
CSS代碼如下:











效果為:

5、段落的第一個字占多行
CSS代碼如下:












這里是完整的代碼以及圖片,下載
posted on 2008-12-22 11:03 一杯清茶 閱讀(112) 評論(0) 編輯 收藏 所屬分類: Struct1.x