CSS+DIV实现圆角
方法一:使用"•"来当圆角:
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<script type="text/javascript">
function doResize()
{
document.getElementById("box-contents").style.height=(document.documentElement.clientHeight-60)+"px";
}
window.onresize = doResize;
</script>
<style type="text/css">
body
{
background-color: black;
margin: 0px;
padding: 0px;
color: White;
font: 16px arial;
}
#content
{
margin: auto;
width: 780px;
height: 100%;
padding: 0 0;
}
div.rounded-box
{
position: relative;
background-color: red;
margin: 3px;
width: 780px;
padding: 0 0;
}
/*********************
GLOBAL ATTRIBUTES
*********************/div.top-left-corner, div.bottom-left-corner, div.top-right-corner, div.bottom-right-corner
{
position: absolute;
width: 20px;
height: 20px;
background-color: black;
overflow: hidden;
}
div.top-left-inside, div.bottom-left-inside, div.top-right-inside, div.bottom-right-inside
{
position: relative;
font-size: 150px;
font-family: arial;
color: red;
line-height: 40px;
}
/*********************
SPECIFIC ATTRIBUTES
*********************/div.top-left-corner
{
top: 0px;
left: 0px;
}
div.bottom-left-corner
{
bottom: 0px;
left: 0px;
}
div.top-right-corner
{
top: 0px;
right: 0px;
}
div.bottom-right-corner
{
bottom: 0px;
right: 0px;
}
div.top-left-inside
{
left: -8px;
}
div.bottom-left-inside
{
left: -8px;
top: -17px;
}
div.top-right-inside
{
left: -25px;
}
div.bottom-right-inside
{
left: -25px;
top: -17px;
}
div.box-contents
{
position: relative;
padding: 8px;
color: white;
}
</style>
</head>
<body onload="doResize();">
<div id="content">
<span>Header</span>
<div class="rounded-box">
<div class="top-left-corner">
<div class="top-left-inside">
•</div>
</div>
<div class="bottom-left-corner">
<div class="bottom-left-inside">
•</div>
</div>
<div class="top-right-corner">
<div class="top-right-inside">
•</div>
</div>
<div class="bottom-right-corner">
<div class="bottom-right-inside">
•</div>
</div>
<div class="box-contents" id="box-contents">
Contents go here, but it must be at least two lines to look any good.
<br>
Contents go here, but it must be at least two lines to look any good.
<br>
Contents go here, but it must be at least two lines to look any good.
<br>
</div>
<!-- end div.box-contents -->
</div>
<!-- end div.rounded-box -->
<span>Footer</span>
</div>
</body>
</html>
方法二:
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
u.corner u
{
height: 1px;
font-size: 1px;
display: block;
overflow: hidden; /*author: meizz*/
text-decoration: none;
background-color: green;
}
u.corner u.h1
{
margin: 0 5px;
}
u.corner u.h2
{
margin: 0 3px;
}
u.corner u.h3
{
margin: 0 2px;
}
u.corner u.h4
{
margin: 0 1px;
height: 2px;
}
</style>
<head>
<body>
<div>
<u class="corner"><u class="h1"></u><u class="h2"></u><u class="h3"></u><u class="h4">
</u></u>
<div style="background-color: green; height: 200">
content</div>
<u class="corner"><u class="h4"></u><u class="h3"></u><u class="h2"></u><u class="h1">
</u></u>
</div>
</body>
</html>
方法三:
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>无标题页</title>
<style>
.up1
{
overflow: hidden;
height: 1px;
margin-left: 4px;
margin-right: 4px;
background-color: Aqua;
border-left: solid 1px Aqua;
border-right: solid 1px Aqua;
}
.up2
{
overflow: hidden;
height: 1px;
margin-left: 3px;
margin-right: 3px;
border-left: solid 1px Aqua;
border-right: solid 1px Aqua;
}
.up3
{
overflow: hidden;
height: 1px;
margin-left: 2px;
margin-right: 2px;
border-left: solid 1px Aqua;
border-right: solid 1px Aqua;
}
.content
{
margin-left: 1px;
margin-right: 1px;
height: 100px; /*这里控件高度*/ /*background-color: Aqua;*/
border-left: solid 1px Aqua;
border-right: solid 1px Aqua;
}
.down1
{
overflow: hidden;
height: 1px;
margin-left: 2px;
margin-right: 2px;
border-left: solid 1px Aqua;
border-right: solid 1px Aqua;
}
.down2
{
overflow: hidden;
height: 1px;
margin-left: 3px;
margin-right: 3px;
border-left: solid 1px Aqua;
border-right: solid 1px Aqua;
}
.down3
{
overflow: hidden;
height: 1px;
margin-left: 4px;
margin-right: 4px;
background-color: Aqua;
border-left: solid 1px Aqua;
border-right: solid 1px Aqua;
}
.cell
{
width: 50px; /*这里控制宽度*/
}
</style>
</head>
<body>
<div class="cell">
<div class="up1">
</div>
<div class="up2">
</div>
<div class="up3">
</div>
<div class="content">
这里放内容
</div>
<div class="down1">
</div>
<div class="down2">
</div>
<div class="down3">
</div>
</div>
</body>
</html>
- 默认分类(20)
- J2EE(25)
- Java(56)
- PHP(55)
- SEO(10)
- 网页设计(20)
- 网站建设(37)
- 数据库(7)
- JavaScript(17)
- JQuery(6)
- MySQL(20)
- SQL Server(6)
- Access(1)
- Oracle(6)
- office(6)
- Dreamweaver(4)
- Photoshop(12)
- Flash(9)
- Fireworks(13)
- CSS(14)
- HTML(4)
- .NET(7)
- ASP(2)
- DB2(1)
- Ajax(2)
- Linux(12)
- Struts(7)
- Hibernate(8)
- Spring(2)
- Jsp(22)
- Asp(8)
- C#(3)
- C++(1)
- 网络安全(5)
- 软件工程(7)
- XML(1)
- English(2)
- 计算机等级考试(2)
- 计算机病毒(4)
- 个人日志(76)
- 互联网(15)
- ActionScript(10)
- Android(3)
- 数据结构与算法(1)
- 游戏策略(3)
- 美文翻译(2)
- 编程开发(19)
- 计算机应用(4)
- 计算机(10)
- Unity3d(6)
- 其他(1)
- egret(1)