html - How to inline 'skewed' li's with no margin between -
i need placing 4 inline li's in div, but, li's need 'horizontally skewed'. need do: (sorry link stack won't let me place pictures)
https://www.flickr.com/photos/107597387@n08/
i can't use css transform -skew tool because skew content inside element (there's image each one), , cut first , last box.
i tried use polygon clip-path, cant manage clear space between boxes.
html:
<div id="somediv" class="colors"> <ul> <li id="c1" class="color">color1</li> <li id="c2" class="color">color2</li> <li id="c3" class="color">color3</li> <li id="c4" class="color">color4</li> </ul> </div
css:
.colors ul li{ display: inline-block; list-style: none; float: left; width: 25%; height: auto; margin-right: 0; padding-top: 5%; padding-bottom: 5%; cursor: pointer; color: white; } .color{ -webkit-clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%); clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%); } #c1{ -webkit-clip-path: polygon(0 0, 100% 0%, 75% 100%, 0% 100%); clip-path: polygon(0 0, 100% 0%, 75% 100%, 0% 100%); background-color: #562b44; } #c2{ background-color: #abf6d6; } #c3{ background-color: #aa2d53; } #c4{ -webkit-clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 0% 100%); clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 0% 100%); background-color: #dca096; }
here's jsfiddle showing what's happening: https://jsfiddle.net/pnvm/zz83zxzd/3/
css shapes don't yet work on older browsers, haven't tried them.
i'm stuck.. please me. thank you
correct me if i'm wrong can't margin-left
eg :
.colors ul li{ margin-left:-6.2% } .colors ul li:first-child{ margin-left:0px } .color{ text-indent:6% }
Comments
Post a Comment