border-radius属性
基本语法:
border-radius:1-4 length %/1-4 length (lenth为圆角半径长度)
应用1:
<html>
<head>
<style>
#{
padding:0;
margin:0;
}
#one{
width:400px;
height:400px;
background:rgb(0,100,255,0.5);
border-radius:50%;
float:left;
position:fixed;
}
#two{
float:left;
width:100px;
height:100px;
background:white;
border-radius:50px;
position:fixed;
left:150px;
top:150px;
}
</style>
</head>
<body>
<div id="one"></div>
<span id="two"</span>
</body>
</html>
效果图如下:
四格三角形应用:
<html>
<head>
<title>document</title>
<style>
div{
width:0;
width:0;
border-top:100px solid red;
border-bottom:100px solid yellow;
border-left:100px solid blue;
border-right:100px solid green
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>
效果图如下:
八格三角形应用1:
<html>
<head>
<title>document</title>
<style type="text/css">
#one{
width: 0;
height:0;
border-top:100px solid #92D050;
border-bottom: 100px solid #FFFF00;
border-left: 100px solid #92D050;
border-right: 100px solid #FFFF00;
}
#two{
width: 0px;
height:0;
left: 200px;
top: -400px;
border-top:100px solid #FF0000;
border-left: 100px solid #0070C0;
border-right: 100px solid #FF0000;
border-bottom:100px solid #0070C0;
position: relative;
}
#three{
width: 0px;
height:0;
border-top:100px solid black;
border-left: 100px solid #7030A0;
border-right: 100px solid black;
border-bottom: 100px solid #7030A0;
}
#four{
width: 0px;
height:0;
left: 200px;
top: -400px;
border-top:100px solid white;
border-left: 100px solid white;
border-right: 100px solid #00B0F0;
border-bottom: 100px solid #00B0F0;
position: relative;
}
</style>
</head>
<body>
<div>
<div id="one"></div>
<div id="three"></div>
<div id="two"></div>
<div id="four"></div>
</div>
</body>
</html>
效果图如下:
八格三角形应用2:
<html>
<head>
<style type="text/css">
#one{
width: 0;
border-top:100px solid #FF0000;
border-bottom: 100px solid #70AD47;
border-left: 100px solid #70AD47;
border-right: 100px solid #FF0000;
}
#two{
width: 0px;
left: 200px;
top: -400px;
position: relative;
border-top:100px solid #44546A;
border-left: 100px solid #44546A;
border-right: 100px solid #FFFF00;
border-bottom: 100px solid #FFFF00;
}
#three{
width: 0px;
border-top:100px solid #7030A0;
border-left: 100px solid #7030A0;
border-right: 100px solid #002060;
border-bottom: 100px solid #002060;
}
#four{
width: 0px;
left: 200px;
top: -400px;
position: relative;
border-top:100px solid #FFC000;
border-left: 100px solid #00B0F0;
border-right: 100px solid #FFC000;
border-bottom: 100px solid #00B0F0;
}
</style>
</head>
<body>
<div id="one"></div>
<div id="three"></div>
<div id="two"></div>
<div id="four"></div>
</body>
</html>
效果图如下:
爱心应用:
<html>
<head>
<style type="text/css">
#a{
background-color: red;
height:100px;
width: 100px;
transform: rotate(45deg);
}
#a:before{
height: 100px;
width: 100px;
left:-45px;
top:-0px;
position: absolute;
display: block;
border-radius: 80px;
background-color: red;
content: " ";
}
#a:after{
height: 100px;
width: 100px;
left:0px;
top:-45px;
display: block;
position: absolute;
border-radius: 80px;
background-color: red;
content: " ";
}
div{
position: absolute;
left: 350px;
top:99px;
}
</style>
</head>
<body>
<div id="a"></div>
</body>
效果图如下:
五角星应用:
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#a {
width: 0px;
height: 0px;
margin: 70px 0;
position: relative;
display: block;
color: yellow;
border-bottom: 80px solid yellow;
border-left: 100px solid transparent;
border-right: 100px solid transparent;
}
#a:before {
width: 0;
height: 0;
top: -45px;
left: -65px;
position: absolute;
display: block;
border-bottom: 80px solid yellow;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
content: '';
transform: rotate(-35deg);
}
#a:after {
width: 0px;
height: 0px;
top: 3px;
left: -105px;
position: absolute;
display: block;
color: yellow;
border-bottom: 70px solid yellow;
border-right: 100px solid transparent;
border-left: 100px solid transparent;
content: '';
transform: rotate(-70deg);
}
</style>
</head>
<body>
<div id="a"></div>
</body>
</html>
效果图如下:
正方形应用: