Erstellen Sie verschiedene Grafiken mit CSS3 (1)

WBOY
Freigeben: 2016-09-05 08:45:38
Original
1210 Leute haben es durchsucht

1、Quadrat

 

<span style="color: #800000;">#square </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> <br>background</span>:<span style="color: #0000ff;"> red</span>; }
Nach dem Login kopieren

 

2、Rechteck

 

<span style="color: #800000;">#rectangle </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 200px</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> <br>background</span>:<span style="color: #0000ff;"> red</span>; }
Nach dem Login kopieren

3、Kreis

 

<span style="color: #800000;">#circle </span>{<br><span style="color: #ff0000;"> width</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> <br>background</span>:<span style="color: #0000ff;"> red</span>;<span style="color: #ff0000;"> <br>-moz-border-radius</span>:<span style="color: #0000ff;"> 50px</span>;<span style="color: #ff0000;"> <br>-webkit-border-radius</span>:<span style="color: #0000ff;"> 50px</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 50px</span>; }<br> <span style="color: #008000;">/*</span><span style="color: #008000;"> Cleaner, but slightly less support: use "50%" as value </span><span style="color: #008000;">*/</span>
Nach dem Login kopieren

4、Oval

 

<span style="color: #800000;">#oval </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 200px</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> <br>background</span>:<span style="color: #0000ff;"> red</span>;<span style="color: #ff0000;"> <br>-moz-border-radius</span>:<span style="color: #0000ff;"> 100px / 50px</span>;<span style="color: #ff0000;"> <br>-webkit-border-radius</span>:<span style="color: #0000ff;"> 100px / 50px</span>;<span style="color: #ff0000;"> <br>border-radius</span>:<span style="color: #0000ff;"> 100px / 50px</span>; } <br><span style="color: #008000;">/*</span><span style="color: #008000;"> Cleaner, but slightly less support: use "50%" as value </span><span style="color: #008000;">*/</span>
Nach dem Login kopieren

5、Dreieck nach oben

 

<span style="color: #800000;">#triangle-up </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-bottom</span>:<span style="color: #0000ff;"> 100px solid red</span>; }
Nach dem Login kopieren

 

6、Dreieck nach unten

 

<span style="color: #800000;">#triangle-down </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-top</span>:<span style="color: #0000ff;"> 100px solid red</span>; }
Nach dem Login kopieren

7、Dreieck links

 

<span style="color: #800000;">#triangle-left </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-top</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>border-bottom</span>:<span style="color: #0000ff;"> 50px solid transparent</span>; }
Nach dem Login kopieren

8、Dreieck rechts

<span style="color: #800000;">#triangle-right </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-top</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>border-bottom</span>:<span style="color: #0000ff;"> 50px solid transparent</span>; }
Nach dem Login kopieren

9、Dreieck oben links

 

<span style="color: #800000;">#triangle-topleft </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-top</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 100px solid transparent</span>; }
Nach dem Login kopieren

10、Dreieck oben rechts

 

<span style="color: #800000;">#triangle-topright </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-top</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 100px solid transparent</span>; }
Nach dem Login kopieren

11、Dreieck unten links

 

<span style="color: #800000;">#triangle-bottomleft </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-bottom</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 100px solid transparent</span>; }
Nach dem Login kopieren

12、Dreieck unten rechts

 

<span style="color: #800000;">#triangle-bottomright </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-bottom</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 100px solid transparent</span>; }
Nach dem Login kopieren

13、Pfeil mit gebogenem Schwanz

 

<span style="color: #800000;">#curvedarrow </span>{<span style="color: #ff0000;"> <br>position</span>:<span style="color: #0000ff;"> relative</span>;<br><span style="color: #ff0000;"> width</span>:<span style="color: #0000ff;"> 0</span>;<br><span style="color: #ff0000;"> height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> border-top</span>:<span style="color: #0000ff;"> 9px solid transparent</span>;<br><span style="color: #ff0000;"> border-right</span>:<span style="color: #0000ff;"> 9px solid red</span>;<span style="color: #ff0000;"> <br>-webkit-transform</span>:<span style="color: #0000ff;"> rotate(10deg)</span>;<br><span style="color: #ff0000;"> -moz-transform</span>:<span style="color: #0000ff;"> rotate(10deg)</span>;<span style="color: #ff0000;"> <br>-ms-transform</span>:<span style="color: #0000ff;"> rotate(10deg)</span>;<br><span style="color: #ff0000;"> -o-transform</span>:<span style="color: #0000ff;"> rotate(10deg)</span>; <br>}<span style="color: #800000;"> <br>#curvedarrow:after </span>{<span style="color: #ff0000;"> <br>content</span>:<span style="color: #0000ff;"> ""</span>;<span style="color: #ff0000;"> <br>position</span>:<span style="color: #0000ff;"> absolute</span>;<br><span style="color: #ff0000;"> border</span>:<span style="color: #0000ff;"> 0 solid transparent</span>;<span style="color: #ff0000;"> <br>border-top</span>:<span style="color: #0000ff;"> 3px solid red</span>;<span style="color: #ff0000;"> <br>border-radius</span>:<span style="color: #0000ff;"> 20px 0 0 0</span>;<span style="color: #ff0000;"> <br>top</span>:<span style="color: #0000ff;"> -12px</span>;<span style="color: #ff0000;"> <br>left</span>:<span style="color: #0000ff;"> -9px</span>;<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 12px</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 12px</span>;<span style="color: #ff0000;"> <br>-webkit-transform</span>:<span style="color: #0000ff;"> rotate(45deg)</span>;<span style="color: #ff0000;"> <br>-moz-transform</span>:<span style="color: #0000ff;"> rotate(45deg)</span>;<span style="color: #ff0000;"> <br>-ms-transform</span>:<span style="color: #0000ff;"> rotate(45deg)</span>;<span style="color: #ff0000;"> <br>-o-transform</span>:<span style="color: #0000ff;"> rotate(45deg)</span>; }
Nach dem Login kopieren

14、Trapez

 

<span style="color: #800000;">#trapezoid </span>{<span style="color: #ff0000;"> <br>border-bottom</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 100px</span>; }
Nach dem Login kopieren

15、Parallelogramm

 

<span style="color: #800000;">#parallelogram </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 150px</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> <br>-webkit-transform</span>:<span style="color: #0000ff;"> skew(20deg)</span>;<span style="color: #ff0000;"> <br>-moz-transform</span>:<span style="color: #0000ff;"> skew(20deg)</span>;<span style="color: #ff0000;"> <br>-o-transform</span>:<span style="color: #0000ff;"> skew(20deg)</span>;<span style="color: #ff0000;"> <br>background</span>:<span style="color: #0000ff;"> red</span>; }
Nach dem Login kopieren

16、Stern (6 Punkte)

 

<span style="color: #800000;">#star-six </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-bottom</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>position</span>:<span style="color: #0000ff;"> relative</span>; }<span style="color: #800000;"> <br>#star-six:after </span>{<span style="color: #ff0000;"> <br>width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;"> <br>border-left</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-right</span>:<span style="color: #0000ff;"> 50px solid transparent</span>;<span style="color: #ff0000;"> <br>border-top</span>:<span style="color: #0000ff;"> 100px solid red</span>;<span style="color: #ff0000;"> <br>position</span>:<span style="color: #0000ff;"> absolute</span>;<span style="color: #ff0000;"> <br>content</span>:<span style="color: #0000ff;"> ""</span>;<span style="color: #ff0000;"> <br>top</span>:<span style="color: #0000ff;"> 30px</span>;<span style="color: #ff0000;"> <br>left</span>:<span style="color: #0000ff;"> -50px</span>; }
Nach dem Login kopieren

17、Stern (5 Punkte)

 

<span style="color: #800000;">#star-five </span>{<span style="color: #ff0000;">
 margin</span>:<span style="color: #0000ff;"> 50px 0</span>;<span style="color: #ff0000;"> 
position</span>:<span style="color: #0000ff;"> relative</span>;<span style="color: #ff0000;"> 
display</span>:<span style="color: #0000ff;"> block</span>;<span style="color: #ff0000;"> 
color</span>:<span style="color: #0000ff;"> red</span>;<span style="color: #ff0000;"> 
width</span>:<span style="color: #0000ff;"> 0px</span>;<span style="color: #ff0000;"> 
height</span>:<span style="color: #0000ff;"> 0px</span>;<span style="color: #ff0000;"> 
border-right</span>:<span style="color: #0000ff;"> 100px solid transparent</span>;<span style="color: #ff0000;"> 
border-bottom</span>:<span style="color: #0000ff;"> 70px solid red</span>;<span style="color: #ff0000;"> 
border-left</span>:<span style="color: #0000ff;"> 100px solid transparent</span>;<span style="color: #ff0000;">
 -moz-transform</span>:<span style="color: #0000ff;"> rotate(35deg)</span>;<span style="color: #ff0000;"> 
-webkit-transform</span>:<span style="color: #0000ff;"> rotate(35deg)</span>;<span style="color: #ff0000;">
 -ms-transform</span>:<span style="color: #0000ff;"> rotate(35deg)</span>;<span style="color: #ff0000;">
 -o-transform</span>:<span style="color: #0000ff;"> rotate(35deg)</span>; }<span style="color: #800000;">
 #star-five:before </span>{<span style="color: #ff0000;"> 
border-bottom</span>:<span style="color: #0000ff;"> 80px solid red</span>;<span style="color: #ff0000;"> 
border-left</span>:<span style="color: #0000ff;"> 30px solid transparent</span>;<span style="color: #ff0000;"> 
border-right</span>:<span style="color: #0000ff;"> 30px solid transparent</span>;<span style="color: #ff0000;"> 
position</span>:<span style="color: #0000ff;"> absolute</span>;<span style="color: #ff0000;"> 
height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;">
 width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;">
 top</span>:<span style="color: #0000ff;"> -45px</span>;<span style="color: #ff0000;"> 
left</span>:<span style="color: #0000ff;"> -65px</span>;<span style="color: #ff0000;"> 
display</span>:<span style="color: #0000ff;"> block</span>;<span style="color: #ff0000;">
 content</span>:<span style="color: #0000ff;"> ''</span>;<span style="color: #ff0000;"> 
-webkit-transform</span>:<span style="color: #0000ff;"> rotate(-35deg)</span>;<span style="color: #ff0000;"> 
-moz-transform</span>:<span style="color: #0000ff;"> rotate(-35deg)</span>;<span style="color: #ff0000;"> -
ms-transform</span>:<span style="color: #0000ff;"> rotate(-35deg)</span>;<span style="color: #ff0000;"> 
-o-transform</span>:<span style="color: #0000ff;"> rotate(-35deg)</span>; }<span style="color: #800000;">
 #star-five:after </span>{<span style="color: #ff0000;"> 
position</span>:<span style="color: #0000ff;"> absolute</span>;<span style="color: #ff0000;"> 
display</span>:<span style="color: #0000ff;"> block</span>;<span style="color: #ff0000;">
 color</span>:<span style="color: #0000ff;"> red</span>;<span style="color: #ff0000;"> 
top</span>:<span style="color: #0000ff;"> 3px</span>;<span style="color: #ff0000;"> 
left</span>:<span style="color: #0000ff;"> -105px</span>;<span style="color: #ff0000;"> 
width</span>:<span style="color: #0000ff;"> 0px</span>;<span style="color: #ff0000;"> 
height</span>:<span style="color: #0000ff;"> 0px</span>;<span style="color: #ff0000;">
 border-right</span>:<span style="color: #0000ff;"> 100px solid transparent</span>;<span style="color: #ff0000;">
 border-bottom</span>:<span style="color: #0000ff;"> 70px solid red</span>;<span style="color: #ff0000;"> 
border-left</span>:<span style="color: #0000ff;"> 100px solid transparent</span>;<span style="color: #ff0000;">
 -webkit-transform</span>:<span style="color: #0000ff;"> rotate(-70deg)</span>;<span style="color: #ff0000;">
 -moz-transform</span>:<span style="color: #0000ff;"> rotate(-70deg)</span>;<span style="color: #ff0000;"> 
-ms-transform</span>:<span style="color: #0000ff;"> rotate(-70deg)</span>;<span style="color: #ff0000;"> 
-o-transform</span>:<span style="color: #0000ff;"> rotate(-70deg)</span>;<span style="color: #ff0000;"> 
content</span>:<span style="color: #0000ff;"> ''</span>; }
Nach dem Login kopieren

18、Fünfeck

 

<span style="color: #800000;">#pentagon </span>{<span style="color: #ff0000;"> 
position</span>:<span style="color: #0000ff;"> relative</span>;<span style="color: #ff0000;"> 
width</span>:<span style="color: #0000ff;"> 54px</span>;<span style="color: #ff0000;"> 
border-width</span>:<span style="color: #0000ff;"> 50px 18px 0</span>;<span style="color: #ff0000;"> 
border-style</span>:<span style="color: #0000ff;"> solid</span>;<span style="color: #ff0000;"> 
border-color</span>:<span style="color: #0000ff;"> red transparent</span>; }<span style="color: #800000;"> 
#pentagon:before </span>{<span style="color: #ff0000;"> content</span>:<span style="color: #0000ff;"> ""</span>;<span style="color: #ff0000;"> 
position</span>:<span style="color: #0000ff;"> absolute</span>;<span style="color: #ff0000;"> 
height</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;">
 width</span>:<span style="color: #0000ff;"> 0</span>;<span style="color: #ff0000;">
 top</span>:<span style="color: #0000ff;"> -85px</span>;<span style="color: #ff0000;">
 left</span>:<span style="color: #0000ff;"> -18px</span>;<span style="color: #ff0000;">
 border-width</span>:<span style="color: #0000ff;"> 0 45px 35px</span>;<span style="color: #ff0000;"> 
border-style</span>:<span style="color: #0000ff;"> solid</span>;<span style="color: #ff0000;"> 
border-color</span>:<span style="color: #0000ff;"> transparent transparent red</span>; }
Nach dem Login kopieren

 

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage