SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: H1, H2, P, ect

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Lincoln
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    H1, H2, P, ect

    Can I ask what benefits I will get from using H1 instead of a simple class? I've always used <div="class"> for font sizes and such, yet I am told that it is better to use H1 and H2 for headers and P for text. If they both achieve the same thing, what is the different between them?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,868
    Mentioned
    159 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    The structure of a document is an important issue especially for accessibility reasons and also for good coding practices.

    Screen readers and the like use the html structural mark-up tags in their representation of the information and help their users identify the structure of a document. Whether its a major heading, a sub-heading or a paragraph are all things that sighted people take for granted, but if you use classes for everything then the document has no structure except for its visible representation.

    The benefits of styling h1, h2 etc is that it also enables consistency throughout your site with out adding any extra mark-up to the html. It also helps in the logical structure of the page in that you start with a heading (h1) and then have a sub heading using (h2) and your paragraphs (p). Indeed if you validate for accessibility using Bobby you will be penalised for starting a page with h2 then following it with h1.

    Irrespective of the accessibility side of things it's also more about structured mark up in exactly the same way that xhtml is more structured e.g. tags must be closed and attributes quoted. Pages become more logical and easier to update so there is an all round benefit.

    The important thing is to use the mark up in the correct context.

    Well that's my opinion anyway - no doubt others will differ

    Paul

  3. #3
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Speech readers, among other things, can use the hierarchical structure of headers to summarise a document for the user.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    Plant City, FL
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not only the accesibility benefits that were mentioned above, but it's said that Google gives you a better ranking by using a logical set of headers. So you get better exposure on the net as well. It's certainly a Good Thing™.
    Matt Burris
    Good Blimey! - My personal blog.
    MattPlays - High-quality, streaming gameplay videos.

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Lincoln
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, is it purely for disabled reasons and better ranking, and what exactly is Bobby? I tried to find out, but didn't understand it.

  6. #6
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Benny Venables
    So, is it purely for disabled reasons and better ranking, and what exactly is Bobby? I tried to find out, but didn't understand it.
    Bobby is a validation engine for Accessibility - found at http://bobby.watchfire.com/bobby/html/en/advanced.jsp

    You might also like to consider Cynthia at http://www.contentquality.com/ or A-Prompt at http://aprompt.snow.utoronto.ca/

    In the first two cases you submit your pages to the site and a report is generated. You can also buy the products.

    A-prompt you can download free.

    In every case you are able to use the resulting report to improve the accessibility of your site. You may also like to consider the Accessibility and Usability forum - http://www.sitepointforums.com/forum...hp?forumid=191 for more information
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  7. #7
    SitePoint Zealot ComputerBob's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thnaks for the excellent links, John -- especially A-prompt, which I had never heard of before.
    ComputerBob - Making Geek-Speak Chic™
    http://www.computerbob.com
    - XHTML 1.0 Strict + CSS Layout
    Ratings | Forums | Software | Polls | Weird | Quotes | Weather
    Guest Articles | Free Greeting Cards | CB Awards | Search

  8. #8
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Lincoln
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, is it illegal to run a website if it doesn't meet Cynthia or Bobby's standards? Cause that 508 thing seems pretty crap to me.

  9. #9
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,204
    Mentioned
    106 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Benny Venables
    So, is it illegal to run a website if it doesn't meet Cynthia or Bobby's standards? Cause that 508 thing seems pretty crap to me.
    It's illegal for government agencies(or those supported directly by gov't funds, I believe) to run sites that don't comply to 508 standards. Others don't have to worry about it, but should if they want to reach the greatest amount of customers possible.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  10. #10
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    Plant City, FL
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not to mention it's The Right Thing To Do. I'm hearing impaired, and I hate renting movies that doesn't have subtitles on it, or watching a show that doesn't support Closed Captioning. I feel left out and disappointed.

    Same for the internet for blind surfers, or for those who can't use a pointing device. Everyone should have the ease of use and ability to partake in the knowledge and community of the internet. I've been teaching myself accessibility guidelines and web standards, and it's nice knowing that, once fully validated, everyone can view my site.

    Just my 2 cents.
    Matt Burris
    Good Blimey! - My personal blog.
    MattPlays - High-quality, streaming gameplay videos.

  11. #11
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Benny Venables
    So, is it illegal to run a website if it doesn't meet Cynthia or Bobby's standards? Cause that 508 thing seems pretty crap to me.
    Two things

    Cynthia and Bobby standards are a guide - a tool for telling you what you've done. They are both based on the work done by http://www.w3.org/WAI/

    In the UK we're bound by the Disability Discrimination Act 1995, which affected goods and services from 1999. In July 2003 a successful presecution was brought against a website owner - see http://www.sitepoint.com/article/1236

    And as a person working in education I'm also bound by the Special Educational Needs and Disability Act 2001.

    Which all seems pretty reasonable to me.

    Whether 508 is broad enough in scope and should include non-governmental organisations is not for me to say.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  12. #12
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you have a heading in your document, you should be able to look at that XHTML (or HTML) without any styles, and still recognise it as a heading.

    This goes for every XHTML element. Always use the right element for the job. You should only use the generic <div> and <span> element when no other element would be suitable in that context. This ensures greater compatibility between browsers and other devices. The other devices which will benefit include:

    - Search engine spiders
    - Screen readers
    - Browsers with poor or no CSS support
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog · Twitter · Contact me
    Neon Javascript Framework · Jokes · Android stuff


Bookmarks

Posting Permissions

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