5 Differences between HTML & CSS

Welcome back to my #CodeWithMeChallenge. Have you seen my introduction post and my 1st two articles here & here. Run to catch up first (Okay, I will wait for you, tick, tick, tock). Welcome back, did you have a good read? Well, i'm sure you did 😛 but if you didn't, you might have to go back & read again (Okay, enough said hahahaha, let's get back to reality). Today's article is a little bit different and from the title you already know where i'm heading to.

After completing my HTML 5 lessons and half way through my CSS 3, there were so many things I discovered/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.

Image from CodingBytes

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, 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 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 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 website 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. 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...🤞

    Lovely Illustration from here

    No comments