Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

'strong' and 'em' styling VS using the 'b' and 'i' tags

Hi there,

On this video, Guil Hernandez explains why we should use 'strong' and 'em' tags instead of 'b' and 'i' tags to italicise and make our text bold. (arround min 3:00)

Isn't styling the 'strong' and 'em' tags the same as styling the 'b' and 'i' tags through CSS?

I don't understand the video's approach, since I can still control the 'b' and 'i' visual result through CSS, just as Guil suggests we do with the 'strong' and 'em' tags.

Thanks in advance! ;)

4 Answers

Ernesto Gamio I have read the article and the question still remains. Thanks btw ;)

The article speaks os code being semantically correct. But at the of day, what does this really mean? Aren't these tags just HTML markers? Can't we manipulate it's visual appearance through CSS too?

Then what is the importance of code being semantically correct? When the user is not going to read code, he is going to read the final product, the text.

Can you please help me understand this?

I believe that one would write semantically correct code so that anyone else that would follow would be able to easily understand and make changes, even years down the road. Otherwise writing anyway you could get the browser to display would be a nightmare. Somewhat like using the word "ain't". It gets the job done, but it's frowned upon!

Jon Benson Yes, I believe that should be the main reason for these differences to exist.

However, I still don't see the need for having the trouble of thinking what kind of tags you are going to use, just to please the semantic meaning of the code you are righting, when, in the end, the only thing that matters is the semantic meaning of the content (the text you are showing on the site it self).

So, I see this as an unnecessary time-consuming coding detail. Nothing that important for the time being.