Creare figure coi CSS

In questa seconda raccolta vediamo altre figure realizzati coi CSS, che ti potranno essere utili sul tuo sito web. In oltre dai stili potrai capire come sono fatte e scrivere del codice per crearne altre. Sono piu veloci nel caricamento rispetto le immagini tradizionali perché  il loro codice e molto piccolo in oltre  possiamo cambiare la grandezza e il colore.

11.Trapezia


.d11 {
height: 0;
width: 100px;
border-bottom: 100px solid #FFE344;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}

12.Parallelogrammo


.d12 {
margin-left: 20px;
width: 150px;
height: 100px;
-webkit-transform: skew(20deg);
-moz-transform: skew(20deg);
-o-transform: skew(20deg);
transform: skew(20deg);
background: #D4D5DA;
}

13.Stella esagonale


.d13 {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid #374F9C;
position: relative;
margin-bottom: 30px;
}
.d13:after {
content: "";
width: 0;
height: 0;
position: absolute;
top: 30px;
left: -50px;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 100px solid #374F9C;
}

14.Stella pentagonale


.d14 {
margin: 50px 0;
height: 0;
width: 0;
position: relative;
border-right: 50px solid transparent;
border-bottom: 35px solid #E7337A;
border-left: 50px solid transparent;
-moz-transform: rotate(35deg);
-webkit-transform:rotate(35deg);
-ms-transform: rotate(35deg);
-o-transform: rotate(35deg);
transform: rotate(35deg);
}
.d14:before, .d14:after {
content: "";
height: 0;
width: 0;
position: absolute;
}
.d14:before {
top: -26px;
left: -32px;
border-bottom: 40px solid #E7337A;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
-webkit-transform: rotate(-35deg);
-moz-transform: rotate(-35deg);
-ms-transform: rotate(-35deg);
-o-transform: rotate(-35deg);
transform: rotate(-35deg);
}
.d14:after {
top: 2px;
left: -53px;
border-right: 50px solid transparent;
border-bottom: 35px solid #E7337A;
border-left: 50px solid transparent;
-webkit-transform: rotate(-70deg);
-moz-transform: rotate(-70deg);
-ms-transform: rotate(-70deg);
-o-transform: rotate(-70deg);
transform: rotate(-70deg);
}

15.Freccia


.d15 {
width: 60px;
height: 20px;
margin: 10px 0;
background: #B74388;
position: relative;
}
.d15:after{
content: "";
width: 0;
height: 0;
position: absolute;
top: -10px;
left: 100%;
border-width: 20px 0 20px 40px;
border-style: solid;
border-color: transparent #B74388;
}

16.Esagono


.d16 {
margin: 20px 0;
width: 100px;
height: 55px;
background: #F1CCAE;
position: relative;
}
.d16:before, .d16:after {
content: "";
width: 0;
height: 0;
position: absolute;
left: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
.d16:before {
top: -25px;
border-bottom: 25px solid #F1CCAE;
}
.d16:after {
bottom: -25px;
border-top: 25px solid #F1CCAE;
}

17.Ottagono


.d17 {
width: 100px;
height: 100px;
background: #54999A;
position: relative;
}
.d17:before, .d17:after {
content: "";
width: 42px;
height: 0;
position: absolute;
left: 0;
border-left: 29px solid white;
border-right: 29px solid white;
}
.d17:before {
top: 0;
border-bottom: 29px solid #54999A;
}
.d17:after {
bottom: 0;
border-top: 29px solid #54999A;
}

18.Cuore


.d18 {
position: relative;
width: 100px;
height: 80px;
}
.d18:before, .d18:after {
content: "";
position: absolute;
left: 50px;
top: 0;
width: 50px;
height: 80px;
background: #EE4156;
border-radius: 50px 50px 0 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
-moz-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
-o-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.d18:after {
left: 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}

19.Rombo


.d19 {
width: 0;
height: 0;
border: 50px solid transparent;
border-bottom-color: #53BA88;
position: relative;
top: -50px;
}
.d19:after {
content: "";
width: 0;
height: 0;
position: absolute;
left: -50px;
top: 50px;
border: 50px solid transparent;
border-top-color: #53BA88;
}

20.Rombo


.d20 {
margin-bottom: 20px;
width: 0;
height: 0;
border: 50px solid transparent;
border-bottom: 70px solid #47002D;
position: relative;
top: -50px;
}
.d20:after {
content: "";
width: 0;
height: 0;
position: absolute;
left: -50px; 
top: 70px;
border: 50px solid transparent;
border-top: 70px solid #47002D;
}

21.Pacman


.d22 {
width: 0;
height: 0;
border-right: 60px solid transparent;
border-top: 60px solid #F4B915;
border-left: 60px solid #F4B915;
border-bottom: 60px solid #F4B915;
border-top-left-radius: 60px;
border-top-right-radius: 60px;
border-bottom-left-radius: 60px;
border-bottom-right-radius: 60px;
}

22.Piccola casa con un tetto


.d23 {
height: 55px;
width: 100px;
background: #B1BA5C;
margin: 35px 20px 0 0;
position: relative;
}
.d23:before {
content: "";
height: 0;
width: 0;
position: absolute;
left: 0;
top: -35px;
border-bottom: 35px solid #B1BA5C;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}

23.Croce


.d24 {
background: #CD6D45;
height: 100px;
width: 20px;
position: relative;
left: 40px;
}
.d24:after {
content: "";
height: 20px;
width: 100px;
background: #CD6D45;
position: absolute;
left: -40px;
top: 40px;
}

24.Segmento


.d25 {
width: 0;
height: 0;
border-left: 70px solid transparent;
border-right: 70px solid transparent;
border-top: 110px solid #2B2F6E;
border-radius: 50%;
}

26. La nuvola di commento.


.d33 {
width: 150px;
height: 80px;
background: #B5DDD4;
position: relative;
border-radius: 10px;
margin-left: 26px;
}
.d33:before {
content: "";
width: 0;
height: 0;
position: absolute;
right: 100%;
top: calc(50% - 12px);
border-top: 12px solid transparent;
border-right: 24px solid #B5DDD4;
border-bottom: 12px solid transparent;
}

26. Nuvola


.d39 {
position: relative;
width: 3em;
height: 3em;
margin: 2em;
background: #D5DEE9;
border-width: 0.25em;
border-style: solid;
border-color: #6E839E;
border-radius: 50% 50% 0 0;
}
.d39:before, .d39:after {
content: "";
position: absolute;
bottom: -0.25em;
background: inherit;
border-width: 0.25em;
border-style: solid;
border-color: #6E839E;
}
.d39:before {
left: 80%;
width: 60%;
height: 60%;
border-left: none;
border-radius: 50% 50% 50% 0;
}
.d39:after {
right: 80%;
width: 80%;
height: 80%;
border-right: none;
border-radius: 50% 50% 0;
}

27. Preloader


.d41 {
width: 0;
height: 0;
margin: 60px;
border: 13px solid transparent;
border-radius:50%;
box-shadow: -30px -30px 0 0 red,
30px 30px 0 0 blue,
-30px 30px 0 0 yellow,
30px -30px 0 0 grey,
0 -45px 0 0 orange,
0 45px 0 0 aqua,
45px 0 0 0 brown,
-45px 0 0 0 crimson;
}

Letto 519 volte