I need help how to slice a div in half when using clip-path polygon

So how to solve this i thought clip path polygon reshapes the entire thing but i was wrong it doesnt seem to do it and my web is overflowing
15 Replies
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Why don't you build your half hexagons from half width divs? You would need to modify the polygon for the clip path, but it would solve the overflow.
.halfHexagon {
width: 3.615rem;
height: 7.23rem;
margin-left: 2px;
margin-right: -100px;
margin-bottom: 5px;
background: #111;
padding-right: -10px;
clip-path: polygon(100% 0, 0% 25%, 0% 75%, 100% 100%);
animation: rgb 4s linear infinite;
transition: 15s;
}
.halfHexagon {
width: 3.615rem;
height: 7.23rem;
margin-left: 2px;
margin-right: -100px;
margin-bottom: 5px;
background: #111;
padding-right: -10px;
clip-path: polygon(100% 0, 0% 25%, 0% 75%, 100% 100%);
animation: rgb 4s linear infinite;
transition: 15s;
}
Siriusly?! not_Rahman!!!
Ok I will check it out But I tried a different approach instead Turned the bug into feat A buggy feet Also won't half width divs ruin the shape?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
It would only be ruined if you don't adjust the clip path. Did you test my code?
Siriusly?! not_Rahman!!!
Well yeah tried smillar method ones but it just broke the shape Need to be perfect center
Siriusly?! not_Rahman!!!
But yeah kinda of problem solved I have actually deprecated the entire halfhexagon function Turned bug into a feat A buggy feet πŸ™ƒ Oh wait Nooo it won't work Gotta experiment tomorrow tired from learning js day 1
Chooβ™šπ•‚π•šπ•Ÿπ•˜
You tried "similar methods" but you did not try my exact code. Here is a demonstration using your code and mine. They produce the exact same shape. https://codepen.io/chooking/pen/poYVXMY
Siriusly?! not_Rahman!!!
oh ok let me try it then πŸ™‚ brooooo
Siriusly?! not_Rahman!!!
same problem what so ever well its not fixable so forget it
Siriusly?! not_Rahman!!!
well here is my solulu
No description
Siriusly?! not_Rahman!!!
welp what to do
Darryll
Darryllβ€’9mo ago
What's the actual issue? You don't want the horizontal scroll? Have you looked into the overflow CSS style? Can be useful on a container to control the scroll It's a simpler way to tackle issues like this without having to mess around with lining up the background perfectly to the container and add new shapes etc which just complicates things
Siriusly?! not_Rahman!!!
Well I am a bit psychotic so I need everything perfect or I would get triggered Well I don't want side scroll
Want results from more Discord servers?
Add your server