DEV Community

Cover image for HTML ⇒ The color Cape
Manu Martinez
Manu Martinez

Posted on

HTML ⇒ The color Cape

Hello tribe, how are you? Today we're going to talk about how to start giving colour to all this stuff we've been talking about since this madness started! give it sugar baby! 👻😈

Give colour?

Yes, I mean using css in html! so, from this post on, we are going to rotate the Wednesday topics between html and css.

Very nice but how do we do it? 🤔

There are three ways to incorporate css into html documents:

  • Inline styles(deprecated)
  • Styles in the head(deprecated)
  • Styles in a style sheet

Inline styles have this form and their use is not recommended:

<p style="color: red;"> red text</p>
Enter fullscreen mode Exit fullscreen mode

Styles that were placed in the head of the document did so in this way and their practice is also discouraged:

<style>
    p{
        color:red;
      }
</style>
Enter fullscreen mode Exit fullscreen mode

Styles with a link:

 <link rel="stylesheet" href="mydoc.css">
Enter fullscreen mode Exit fullscreen mode

This last one is recommended as it allows a huge improvement when loading the page as it means fewer lines in the html document as opposed to the first ones that I mentioned, so the performance of the page goes up like crazy.😜

Well guys raise your swords because CSS is coming! .⚔😎
Thanks for reading today's post and remember to be the best version of you

Top comments (0)