CSS圓角背景,適用於各主流瀏覽器的兼容

(1)全部的代碼

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Test</title>
<style type="text/css">
body,div {
margin: 0;
padding: 0;
}
body {
text-align: center;
}
.coner {
margin:20px;
position: relative;
padding: 11px;
width: 200px;
height: 150px;
background-color:#DCEAFF;
}
.comm {
position: absolute;
width: 11px;
height: 11px;
background: url(corner.gif) no-repeat;
}
.leftTop {
top:0;
left:0;
background-position: -1px -1px;
}
.rightTop {
top:0;
right:0;
background-position: -12px -1px;
}
.leftBottom {
left: 0;
bottom: 0;
background-position: -1px -12px;
}
.rightBottom {
right:0;
bottom: 0;
background-position: -12px -12px;
}
</style>
</head>
<body>
<div class="coner">
<div class="comm leftTop"></div>
<div class="comm rightTop"></div>
<div class="comm leftBottom"></div>
<div class="comm rightBottom"></div>
</div>
</body>
</html>

(2)效果如下:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章