Skip to content

Instantly share code, notes, and snippets.

@stoikerty
Last active December 26, 2015 01:29
Show Gist options
  • Save stoikerty/7071444 to your computer and use it in GitHub Desktop.
Save stoikerty/7071444 to your computer and use it in GitHub Desktop.
A snippet of code to remind myself the power of svg independent positioning
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-triangle">
<g transform="scale(0.4 0.4)">
<polygon points="0,0 100,0 50,100"/>
</g>
</svg>
<svg class="svg-triangle" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet">
<polygon points="0,0 100,0 50,100"/>
</svg>
.svg-triangle{
z-index: 2;
position:relative;
display:block;
width: 100%;
height: 100px;
//top :0;
left :0;
}
.svg-triangle polygon{
fill:#98d02e;
stroke:#65b81d;
stroke-width:2;
}
.svg-triangle polygon{
fill:#98d02e;
stroke:#65b81d;
stroke-width:2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment