+ 6

Triangles

How do draw a triangle in css?

1st Nov 2018, 8:53 PM
Zachary Burkholder
Zachary Burkholder - avatar
3 Réponses
+ 14
https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_shapes_triangle-up <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .triangle-up { width: 0; height: 0; border-left: 25px solid transparent; border-right: 25px solid transparent; border-bottom: 50px solid #0f0; } </style> </head> <body> <h2>Triangle Up CSS</h2> <div class="triangle-up"></div> </body> </html>
1st Nov 2018, 9:11 PM
BroFar
BroFar - avatar
+ 1
.triangle { width: 200px; height: 200px; background-image: linear-gradient(-45deg, red 49.9%, transparent 50%); } https://code.sololearn.com/WWNxohxfdr34/?ref=app
2nd Nov 2018, 12:27 AM
Calviղ
Calviղ - avatar