Last active
December 26, 2015 01:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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