Results 1 to 4 of 4

Thread: [RESOLVED] [HTML] Question on <h> tags

  1. #1

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,376

    Resolved [RESOLVED] [HTML] Question on <h> tags

    I'm teaching myself HTML and what I'm doing is writting a vb.net tutorial in pure html since I'm allready familiar with vb.net. My question is, with <h> tags right now I'm doing this:
    html Code:
    1. <h1 id="variables">
    2.    <font color="black">
    3.    Visual Basic.Net - Variables
    4.    </font>
    5.   </h1>
    6.  
    7.   <h2 id="datatypes">
    8.    <center>
    9.     <font color="blue">
    10.     Data Types
    11.     </font>
    12.    </center>
    13.   </h2>
    14.  
    15. <h3 id="syntax">
    16.    <center>
    17.     <font color="blue">
    18.      Syntax
    19.     </font>
    20.    </center>
    21.   </h3>

    I do want the <h1> to be the biggest, because that's the main point of this particular article. But my question is, for the datatypes and syntax, could I use <h2> for both, just with a different ID, like this:

    html Code:
    1. <h2 id="datatypes">
    2.    <center>
    3.     <font color="blue">
    4.     Data Types
    5.     </font>
    6.    </center>
    7.   </h2>
    8.  
    9. <h2 id="syntax">
    10.    <center>
    11.     <font color="blue">
    12.      Syntax
    13.     </font>
    14.    </center>
    15.   </h3>

    or is that not good practice?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [HTML] Question on <h> tags

    well... are they at the same level, or is syntax a sub-header of datatypes? Think of H tags a being part of an outline... h1 is your 1. line... h2 would be your 1.1 line, and h3 would be 1.1.1 ... so if syntax is a subheader of datatypes, and you want this:
    1 - Variables
    1.1 - Datatypes
    1.1.1 - Syntax

    then use h1/h2/h3

    But if you want
    1 - Variables
    1.1 - Datatypes
    1.2 - Syntax

    then use h1/h2/h2
    (hint this is the option that in my opinion is the correct one semantically)

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,376

    Re: [HTML] Question on <h> tags

    Thanks TG, that cleared it up for me. The latter is what I was aiming for.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] [HTML] Question on <h> tags

    jsut for edification.... to get

    1 - Variables
    1.1 - Datatypes
    1.1.1 - Value Types
    1.1.2 - Reference Types
    1.2 - Syntax
    it's h1
    h2
    h3
    h3
    h2
    .
    .
    .

    as I stated the H tags can be thought of the header lines of an outline.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width