I want to use basic CSS to make triangle in an HTML page. I am using triangle pics which take time to load, so, I want to decrease loading time of my page.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
This will make a triangle
The trick behind making a css triangle is
div
Hope this helps.
Check this jsFiddle
Not possible with HTML, but with CSS. Example:
Live demo: jsFiddle
30px
in theborder
property defines the size: width and height. You can change it if you want a smaller or a bigger triangle.black
andtransparent
in theborder-color
property. See jsFiddleThis is the best explanation on how to create CSS triangles: http://www.uselesspickles.com/triangles/
By creating divs without width or height, the borders end up creating a triangle when you leave some of the borders as transparent.
Credit That page was written by a co-worker, way before other people figured out this trick.
jsFiddle demo