Shape Outside for envelope
hello i have my animated envelope and i wanna make shapeoutside for bottom to fit in polygons on left and right
15 Replies
2 triangles its an example what i want
i wanna them to be at the bottom but still float
to use shape outside
perphaps some other solution will suit for this
Can you share the code that you have so far? Ideally in a codepen or similar? Doing so will make it easier both for people to understand what you want to do and to be able to help you.
https://uiverse.io/SmookyDev/nasty-zebra-5
its where from i took template
then add couple lines of text
i want text to have same boundries as envelope
i have two triangles with shape
Rather than "mt-auto", try defining a value. "mt-12" seems to get them in the right place.
However with shape-outside it is going to be tricky to get the contents in within the space, clearly it is going to depend on the actual length of the text (and size of the envelope etc.
i guess somwhere exists a better solution than mt
but thx
You could adjust the clip-paths themselves.
I adjusted them to this:
Note - I remove the aspect ratio as that was preventing them from reaching the bottom of their container. I also removed the bottom padding on the container.
thx i`ll try it!
looks weird
doesnt work as i expected...
The code that I shared was based on the link that you sent. Those captures look like they are based on different code so you will need to adapt it to fit. Ideally it would help if you shared the actual code.
its almost same
same container inside
just other colors
ive changed polygons a little
just want them to fit in boundries
should work but idk why text is shrinking
also we dont even need all this code, single div and bunch of text with these two polygons will be enough though
As I say, the actual numbers will depend on the rest of the code. Using custom properties might make this easier (especially if it were done using pure CSS).
For reference, here is my fork of the code that you posted with the shape-outside percentages adjusted to fit the size of the envelope
https://codepen.io/cbolson/pen/mdZqaOe
(note - I removed the clip-path as it is only helpful for visulisation, it isn't actually needed)
nah its okay i just have bunch custom vars in my config and its not necessary
i got full idea with this example
thats most important thing
thx again)