DEV Community

Discussion on: 30 Web Developer Interview Questions (With Answers)

Collapse
 
_dsasko profile image
Denis Šaško

Thanks for the post.

Small correction in 3. Optimize this HTML code with proper semantic elements.
<h2>This is a blog subtitle</h2> is neither semantic nor in the original part of the code.

Collapse
 
gedalyakrycer profile image
Gedalya Krycer

No problem and thank you for catching that typo! I’ll add the subhead in the original code shortly. :)

Could you elaborate on how it would not be semantic? To my understanding, text that summarizes or leads into a topic specific block of text, would be a good candidate for headline tags. And the less impactful a headline is to the main subject, the smaller designation it would get. (From h1-h6).

But eager to learn something new about it if that understanding is not correct. Thanks!

Collapse
 
_dsasko profile image
Denis Šaško

I agree with what you said, but the word "subtitle" is what bugs me. Headings should use the h1-h6 tags, yet subheadings (or subtitles) should be put in a regular p tags. So imho either the text inside your h2 is wrong or the h2 itself is.

Thread Thread
 
gedalyakrycer profile image
Gedalya Krycer

Ah, that makes sense now. I can see how "subhead/subtitle" could communicate something different.

My intention was for a "level 2 headline/title" vs text that follows a headline/title. I agree that in the latter case a <p> tag would be better served. :)