使用border画原和三角形。以及加边框阴影效果。

html源代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="../css/border.css">
</head>
<body>
<header></header>
<article></article>
<section></section>
<div></div>
<footer></footer>
<div></div>
<div></div>
</body>
</html>
 
CSS源代码:
*{
margin: 0 auto;
}
header{
width: 0px;
height: 0px;
border-top: 50px solid red;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 50px solid transparent;
}
article{
width: 0px;
height: 0px;
border-top: 50px solid transparent;
border-left: 50px solid blue;
border-right: 50px solid transparent;
border-bottom: 50px solid transparent;
}
section{
width: 0px;
height: 0px;
border-top: 50px solid transparent;
border-left: 50px solid transparent;
border-right: 50px solid green;
border-bottom: 50px solid transparent;
}
div{
width: 0px;
height: 0px;
border-top: 50px solid transparent;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 50px solid orange;
}
footer{
width: 100px;
height: 100px;
border: 3px solid red;
box-shadow: brown 10px 10px 20px 6px;
margin-top: 30px;
}
footer+div{
width: 100px;
height: 100px;
border: 3px solid blue;
box-shadow: orange 10px 10px 20px 6px inset;
margin-top: 30px;
}
div+div{
width: 100px;
height: 100px;
border:3px solid palevioletred;
border-radius: 50%;
 
}

 

转载于:https://www.cnblogs.com/dmiao/p/9539253.html

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐