mardi 30 avril 2019

Blank screen when trying to draw a triangle with HTML and CSS

I am trying to draw a triangle with HTML and CSS. But I am unable to do it succesfully.

I looked up the most common solution for drawing triangle in CSS.

This the HTML code:

<html>
    <head>
        <link rel="stylesheet" href="tiangle.css" type="text/css">
    </head>
    <body>
        <div id = 'triangle-up'></div>
    </body>
</html>

This is the CSS code:

#triangle-up {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid red;
  }

The code should draw a red colored upward-facing triangle, but it displays a blank white page. Please help.




Aucun commentaire:

Enregistrer un commentaire