Home > Web Front-end > HTML Tutorial > CSS画出的图_html/css_WEB-ITnose

CSS画出的图_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:32:14
Original
941 people have browsed it

目录 [1]矩形 [2]圆形 [3]椭圆 [4]直角三角形 [5]正三角形 [6]平行四边形 [7]梯形 [8]六角星 [9]六边形 [10]五角星

简单图形

矩形

div{    width: 100px;    height: 100px;    background-color: red;}
Copy after login

圆形

div{    width: 100px;    height: 100px;    background-color: red;    border-radius: 50%;}
Copy after login

椭圆

div{    width: 100px;    height: 50px;    background-color: red;    border-radius: 50%;}
Copy after login

直角三角形

div{    width: 0;    height: 0;    border: 50px solid transparent;    border-bottom-color: red;}
Copy after login

正三角形

div{    width: 0;    height: 0;    border: 50px solid transparent;    border-width: 86.6px 50px;    border-bottom-color: red;}
Copy after login

平行四边形

div{    margin-left: 50px;    width: 100px;    height: 100px;    background-color: red;    transform: skew(30deg);}
Copy after login

梯形

div{    width: 50px;    border: 50px solid transparent;    border-bottom-color: red;}
Copy after login

复杂图形

六角星

  两个三角形叠压

div{    position: relative;    width: 0;    border: 50px solid transparent;    border-width: 50px 43.4px;    border-bottom-color: red;}div:after{    position: absolute;    content:"";    width: 0;    border: 50px solid transparent;    border-width: 50px 43.4px;    border-top-color: red;    top: 16px;    left: -42px;}
Copy after login

六边形

  两个梯形拼接

div{    position: relative;    width: 50px;    border: 50px solid transparent;    border-bottom-color: red;}div:after{    position: absolute;    content:"";    width: 50px;    border: 50px solid transparent;    border-top-color: red;        top:50px;    left: -50px;}
Copy after login

五角星

  一个大三角形底部掏掉一个小三角形;两个前面的相同图形叠压

<body>  <div></div>  <div></div>        </body>
Copy after login

div {     margin-left: 100px;    position: relative;     width: 0px;     border: 50px solid transparent;     border-width: 100px 35px;    border-bottom-color: red; }  div:after{    content: "";    position:absolute;    width: 0;    border: 100px solid transparent;    border-width: 25px 50px;    border-bottom-color: white;    top: 51px;    left: -50px;}div:last-child{    top: -164px;    left: 52px;    transform: rotate(72deg);}
Copy after login

 

持续更新…………

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template