Home > OS >  HTML SVG Positioning?
HTML SVG Positioning?

Time:08-13

so i have a little problem with a svg, this svg is align on left side, but i want make it to the right side, I've tried using x and y but its not working, please help me

<svg width="498" height="99" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 36C0 2.863 26.8629-24 60-24h438V99H60C26.8629 99 0 72.1371 0 39v-3Z" fill="#2D2D2D"/></svg>

CodePudding user response:

Like this?

<svg width="498" height="99" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 36C0 2.863 26.8629-24 60-24h438V99H60C26.8629 99 0 72.1371 0 39v-3Z" fill="#2D2D2D" transform="scale (-1, 1)" transform-origin="center" />
</svg>

CodePudding user response:

You can use an outer div like this:

<div class='outer-div' > 
    <!-- SVG Element -->
    <svg></svg>
</div>

And in the CSS file:

.outer-div{
    display:flex;
    flex-direction: row-reverse;
}
  • Related