2016-08-05 85 views
1

Ist es möglich, mit Styles ein DIV so zu erstellen?CSS: Sockelleiste

enter image description here enter image description here

meine ich die Struktur des Sockels. Ein ähnlicher 3D-Effekt

Antwort

2

Es ist irgendwie möglich. Sie können background: linear-gradient() für die Farben und mehrere divs mit border-radius für die Form und unterschiedlichen Höhen und Breiten verwendet werden, zB:

.wrapper { 
 
    width: 300px; 
 
} 
 
.layer1 { 
 
    height: 10px; 
 
    width: 300px; 
 
    float: right; 
 
    border-bottom-left-radius: 8px; 
 
    background: #eeeeee; 
 
    /* Old browsers */ 
 
    background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); 
 
    /* FF3.6-15 */ 
 
    background: -webkit-linear-gradient(top, #eeeeee 0%, #cccccc 100%); 
 
    /* Chrome10-25,Safari5.1-6 */ 
 
    background: linear-gradient(to bottom, #eeeeee 0%, #cccccc 100%); 
 
    /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 
 
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0); 
 
    /* IE6-9 */ 
 
} 
 
.layer2 { 
 
    height: 30px; 
 
    width: 280px; 
 
    float: right; 
 
    border-bottom-left-radius: 25px; 
 
    background: #b5b5b5; 
 
    /* Old browsers */ 
 
    background: -moz-linear-gradient(top, #b5b5b5 0%, #eeeeee 48%, #cccccc 100%); 
 
    /* FF3.6-15 */ 
 
    background: -webkit-linear-gradient(top, #b5b5b5 0%, #eeeeee 48%, #cccccc 100%); 
 
    /* Chrome10-25,Safari5.1-6 */ 
 
    background: linear-gradient(to bottom, #b5b5b5 0%, #eeeeee 48%, #cccccc 100%); 
 
    /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 
 
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#b5b5b5', endColorstr='#cccccc', GradientType=0); 
 
    /* IE6-9 */ 
 
} 
 
.layer3 { 
 
    height: 20px; 
 
    width: 230px; 
 
    float: right; 
 
    border-bottom-left-radius: 15px; 
 
    background: #eeeeee; 
 
    /* Old browsers */ 
 
    background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); 
 
    /* FF3.6-15 */ 
 
    background: -webkit-linear-gradient(top, #eeeeee 0%, #cccccc 100%); 
 
    /* Chrome10-25,Safari5.1-6 */ 
 
    background: linear-gradient(to bottom, #eeeeee 0%, #cccccc 100%); 
 
    /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 
 
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0); 
 
    /* IE6-9 */ 
 
}
<div class="wrapper"> 
 
    <div class="layer1"></div> 
 
    <div class="layer2"></div> 
 
    <div class="layer3"></div> 
 
</div>

Nur mit den Eigenschaften ein wenig herumspielen und ich bin sicher, Sie werden schöne Ergebnisse bekommen. Das obige ist nur ein schnelles hässliches Beispiel ...

Einschränkungen: Mit diesem Ansatz ist es nur möglich, konvexe Kurven zu erstellen.

+1

Es sieht perfekt aus - Danke – Lola