Ich habe diese Form mit Pseudo-Elementen:bester Weg, um diese (Trapez) Form in css3 machen
https://jsfiddle.net/6gf1m3j5/
body {
margin: 0;
background:#ccc;
}
#octagon-left {
background: red none repeat scroll 0 0;
height: 60px;
width: 100%;
}
#octagon-left::before {
border-left: 100px solid white;
border-top: 60px solid red;
content: "";
height: 0;
margin: 0;
position: absolute;
top: 0;
width: 40px;
}
#octagon-left::after {
border-right: 100px solid white;
border-top: 60px solid red;
content: "";
height: 0;
margin: 0;
position: absolute;
right: 0;
top: 0;
width: 40px;
}
Das Problem hier ist die weiße Farbe in der linken und rechten Ecke.
Wenn ich es tue, Rand links: 100px solide transparent; die Farbe Rot ist vorherrschend.
Wie kann ich das tun?
Ich schätze wirklich Ihre Unterstützung, danke.
Danke für Ihre Unterstützung. –
Ich habe hier ein kleines Problem, wenn ich 100% hinzufügen (volle Breite): #octagon { Breite: 100%; } das funktioniert nicht, ich brauche mein Beispiel aber mit transparent. https://jsfiddle.net/6gf1m3j5/ –
@Thenning Haben Sie weitere Spezifikationen wie z. ob die Höhe fest ist oder so? –