Sumit | Javascript + React
Sumit | Javascript + React

@sumitsaurabh927

11 Tweets 1 reads Mar 02, 2023
๐Ÿ“Œ HTML: The missing piece!
๐Ÿงต One key thing that people learning web development miss out on:๐Ÿ‘‡
It is easy to say which tag does what when working with HTML.
For example, with the 'p' tag, we know it is a paragraph on the page.
But for some tags, it is not blatantly obvious.
This often leads to confusion.๐Ÿ‘‡
For example, take the 'emphasis' and 'strong' tags.
At first glance, one italicizes the text while the other boldens it.
If you also think this way then my friend you're wrong.
You see HTML deals with the semantic meaning of content and not presentational meaning.
This means that it is only concerned with 'what' is on a web page and not 'how' it looks.
How something looks on a page is the concern of CSS.
This means that every tag used in the html document should have some semantic meaning.
And that means that there should be semantic reasoning behind why you chose a particular tag.
For example, say I were to write an article with three paragraphs, then I'd choose an 'article' tag and within it, I'll nest three 'paragraph' tags.
Simple, right?
It is.
Untill you encounter 'not so obvious' tags like 'emphasis' or 'strong' tags.
If HTML tags were to give out semantic meaning, what shall we use 'emphasis' or 'strong' tags for?
All they seem to do is just italicize and bolden a piece of text.
Well, we use them to place 'emphasis' on some text or to textually 'shout' from a page.
The emphasis tag is used when you want to place emphasis on text or to draw the reader's attention to some text.
Similarly, using 'strong' is equal to shouting, but using text.
The very fact that we can un-italicize text that is inside an emphasis text and un-bolden text that is inside a strong tag using CSS tells us that CSS is what should determine how something is rendered on the browser.
HTML is only for 'what' goes on a page and nothing else.
Here's a thread on Semantic HTML if you wanna learn more about it:
That's a wrap!
If you enjoyed this thread:
1. Follow me @sumitsaurabh927 for more of these
2. RT the tweet below to share this thread and show me some love! ๐Ÿงก๐Ÿงก๐Ÿงก

Loading suggestions...