Skip to main content
Inspiring
Mar 16, 2020 12:08 PM UTC
Question

About workflow and stuff about hashtags and order.

About workflow and stuff. Why the #header is only made for the header and the #header h1 not for h1?

Why people push #header h1 under #header?

 

    This topic is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    BenPleysier
    Community Expert
    Community Expert
    Mar 17, 2020 2:04 AM UTC

    In addition to what Jon and Nancy have said, I am glad that the article that Nancy referred to - https://www.w3schools.com/html/html5_semantic_elements.asp - does expand on the use of headers and footers. These are not only used in the main document, but can also be used in other elements that require a header.

     

    Having said that, in my personal opinion, an outline of the document is the most important goal for SEO and screen readers. This is where header tags play an important role. As an example, have a look at

    What this tells me is that both the body and the nav elements have no heading (hx).

    Translate
    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Nancy OShea
    Community Expert
    Community Expert
    Mar 16, 2020 8:19 PM UTC

    I recommend that you stick with semantic HTML5 tags as selectors.  In other words, don't use unique IDs unless you absolutely need them for JavaScript.   Semantic tags give meaning and structure to content as well as acting as hooks for your CSS styles to grab onto.   See graphic and link below for commonly used semantic HTML5 tags.

     

    Figure from W3Schools

    https://www.w3schools.com/html/html5_semantic_elements.asp

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    Mar 16, 2020 1:11 PM UTC

    I'm not sure what you're asking.

    If you're asking about the relation between the <header> tag and the #header id, there really isn't one, generally speaking. They're separate things in html and css. If you are using a javascript that requires the use of an id="header" using the <header> html tag won't be enough by itself. That's probably why you have <header id="header">. 

    HTML                  CSS
    <header>              header 

    id="header"         #header 

    class="header"     .header


    Translate