Je développe un menu avec la forme mais en safari cela ne fonctionne pas bien. En safari cela endommage la disposition et je ne sais pas pourquoi. Si je n'utilise pas svg tag et n'utilise que css clip-path cela marche bien dans safari et chrome mais pas dans firefox.CSS - Clip-path ne fonctionne pas bien sur safari
Css:
.menu {
width: 65%;
height: 40px;
background-color: red;
-webkit-clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%, 0 100%);
clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%, 0 100%);
-webkit-clip-path: url("#clipping");
clip-path: url("#clipping");
position: absolute;
right: 0px;
bottom: 0;
}
.menu:before {
content: '';
width: 99.8%;
height: 40px;
-webkit-clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%, 0 100%);
clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%, 0 100%);
-webkit-clip-path: url("#clipping");
clip-path: url("#clipping");
background: black;
display: block;
position: absolute;
top: 2px;
left: 2px;
right: 2px;
}
html:
<div class="menu">
<svg width='0' height='0'>
<defs>
<clipPath id="clipping" clipPathUnits="objectBoundingBox">
<polygon points="0.05 0, 1 0, 1 1, 0 1, 0 1" />
</clipPath>
</defs>
</svg>
</div>
Merci
soutien partiel fait référence à des formes de soutien et la syntaxe URL (#foo) pour SVG en ligne, mais pas dans les formes SVGs externes. http://caniuse.com/#search=clip-path – Rob
alors, comment puis-je faire cela? @Rob – user3242861