曲线图片效果:
代码和注释如下:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<style type="text/css">
div,h1,body{margin: 0;padding: 0;}
.con{
width: 500px;
height: 200px;
margin: 100px auto;
/*将背景设置为白色*/
background: #fff;
}
.shadow{
/*设置正面阴影*/
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-o-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
position: relative;
}
.shadow:before,.shadow:after{
content: '';
width: 90%;
height: 50%;
/*使得空的块置于最底层*/
z-index: -1;
background: red;
/*让空的块定位*/
position: absolute;
bottom: 0;
left: 28px;
border-radius: 15%;
/*制作负阴影效果*/
box-shadow: 0 8px 10px rgba(0,0,0,0.4);
}
.con h1{
text-align: center;
line-height: 200px;
}
</style>
</head>
<body>
<div class="con shadow">
<h1>HELLO WORLD!</h1>
</div>
</body>
</html>