mercredi 4 février 2015

How do I write over a triangle-shaped div using CSS?


I'm currently trying to write words over a triangle-shaped div that I created using CSS.


Here:





.triangle-topright {
width: 0;
height: 0;
border-top: 100px solid gray;
border-left: 100px solid transparent;
}



<div class="triangle-topright">view</div>


As you can see, view is misplaced as I want it to be inside the shape. I also want it to rotate so It's nice for the eye. I know that text rotation goes something like this (example):



-moz-transform: rotate(-90deg);


Can I achieve the goal using CSS or do I need to add some JS?


Thanks a lot!





Aucun commentaire:

Enregistrer un commentaire