5 Differences between HTML and CSS

After I completed my HTML 5 lessons and halfway through my CSS 3, there were so many things I learnt. As a "sharer" that I am, I have decided to share my top 5 differences with y'all. So, let's dive right into it.

1. In terms of definition, HTML stands for Hypertext Markup Language while CSS stands for Cascading Style Sheets.

2. The main difference between HTML and CSS is that HTML is a markup language that is used to create the actual content and structure of a web page while CSS is a styling language that is used to make the web page more presentable. More or less like CSS is used to "beautify" your code. When I say beautify, I mean styling, cascading, and change of fonts/background colours, amongst others.

3. HTML is a static language as it cannot generate dynamic outputs, unlike CSS which is more flexible, easy to maintain and has a much broader range of attributes. Talking about flexibility, quick fact: Do you know that you can use CSS in an HTML file but you cannot use HTML in a CSS style sheet (confused yet?, nah, you can't be. Read that sentence again and tell me if you understand it better now 😋).  Anyways, basically, what that means is that HTML syntax and style structure cannot be used in CSS style sheets but CSS is independent of HTML and can be used in any XML language.

4. HTML uses tags to create its contents. E.g.: <tag = "value1"> "content" </tag> while the CSS rule set consists of selectors and a declaration block. E.g: <style> {background-color: green;} </style>

5. Finally, while using HTML, you have to write more code each time you want to add an attribute to one of your elements. That means that each paragraph, section, and link needs to have its own code instructions to behave exactly how you want them to. However, you can avoid that excessive coding in CSS by assigning a single class which will be referred to throughout your code.

Final Thoughts:
The bottom line is that you still need both of them to create the best outcome. More like HTML is the skeleton while CSS is the skin. So both of them definitely need each other. I started learning HTML 5 before I moved to CSS 3. From the little I've learnt, I've seen that CSS has more features and attributes to make your work simpler and more beautiful than HTML. Remember that, HTML is the backbone of contents, so no matter how static it might be, you still need it. In conclusion, designers create better websites working with both of them. So they are both winners in my own opinion and you have to learn the two. That is it from me today. 

    Lovely Illustration from here

      Thank you so much for stopping by in my little corner. I hope you have learnt one/two take homes from me today. Hope to see you again...🤞

      HAPPY CODING!!! ❤️