svg path creating space

Hey, i wanted text to fill the container it was in so i opted for an svg approach, the only problem is, the path creates excess space around the svg (see image). I'd like the "text" to touch the edge of the container (in this case the body) Is this a deliberate feature or perhaps something else? I'd appreciate if anyone could let me know what's causing that, thanks in advance. https://codepen.io/deerCabin/pen/NPKxWoR
R
CodePen
svg text
...
No description
9 Replies
ἔρως
ἔρως2w ago
no, that's how you designed the path
No description
ἔρως
ἔρως2w ago
also, leave the space seriously unless you want to put this somewhere else, and not as a direct descendent of the body
b1mind
b1mind2w ago
You can also just export the SVG with a better viewbox. Or this is where changing the viewbox start x y positions would come into play.
snxxwyy
snxxwyyOP2w ago
I just exported it from figma tbh so perhaps it's something with the way they do it, and yeah it's only a descendant of the body in the example, it's part of a hero section so it messes up the left alignment of content making it look out of place.
ἔρως
ἔρως2w ago
you can also make it into text
b1mind
b1mind2w ago
yea you can use <text> Then just x= y= the starting pos
ἔρως
ἔρως2w ago
and the target width too
b1mind
b1mind2w ago
If you were to use that path in your example you could change the viewport="0.5 0.5 31 10" but then you will have the spacing on the right 🤷‍♂️ Also keep in mind that the viewbox is infinite and you can set it to overflow: visible; to have a bounding box that is smaller than the image. This allows you to overflow thing but have the viewbox control whats visible and in css how things react to resizing.
snxxwyy
snxxwyyOP2w ago
oh yeah i've heard about <text>, i might take a look into that. and that overflow visible thing seems interesting too, thank you both
Want results from more Discord servers?
Add your server