SitePoint Sponsor |
|
User Tag List
Results 1 to 19 of 19
-
Oct 15, 2006, 15:33 #1
- Join Date
- Feb 2003
- Location
- eez
- Posts
- 331
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The way headings are defined in "semantical" web sites is intellectual dishonesty
Hi.
It's very well explained so careful reading will pay off.
HTML Code:<h1>Articles</h1> ... h1 content (some articles) // end of <h1>
Is this legal? Of course it is. OK!
HTML Code:<h1>Articles</h1> <h2>Article 1</h2> ... h2 content (article 1) <h2>Article 2</h2> ... h2 content (article 2) <h2>Article 3</h2> ... h2 content (article 3) // end of <h1>
Is this legal? Of course it is. OK!
Let's all start thinking. Consider this:
HTML Code:<h1>Articles</h1> <ul>...</ul>// Order by & sort menu. <h2>Article 1</h2> ... h2 content (article 1) <h2>Article 2</h2> ... h2 content (article 2) <h2>Article 3</h2> ... h2 content (article 3) <ul>...</ul>// Navigation menu (does NOT belong to last <h2>) // end of <h1>
Is this legal? It isn't. In a <h1> (or any heading for that matter), if there are sub-headings (<h2>s in our example), you must continue using those sub-headings throughout the entire <h1>. So this example is unsemantical and false. Remark: If the first <ul> under the <h1> was a paragraph further clarifying the contents of the <h1> that would of course have been acceptable! (Only exception!)
Now consider this:
HTML Code:<h1>Articles</h1> <h2>Order Menu</h2> <ul>...</ul> <h2>Article 1</h2> ... h2 content (article 1) <h2>Article 2</h2> ... h2 content (article 2) <h2>Article 3</h2> ... h2 content (article 3) <h2>Navigation Menu</h2> <ul>...</ul> // end of <h1>
Is this legal? It still isn't. In fact, the nature of the <h2>s throughout the <h1> is not the same so it is horribly unsemantical (An article is not of the same nature as a navigation menu or order by menu!).
Solution: Well, ... now it's your turn to come up with the a solution.
More examples will follow.
Thanks for reading.
-
Oct 15, 2006, 15:41 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
i do not understand what you mean when you write stuff like this --
// end of <h1>
want to know where the h1 ends? it is right here ---> </h1>
have you run all of those html fragments through the validator? what sort of errors/warnings did you get?
-
Oct 15, 2006, 16:00 #3
- Join Date
- Apr 2006
- Location
- Scotland
- Posts
- 325
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
agw - Sorry no offence but thats the biggest load of cr@p ive read since joining SP
-
Oct 15, 2006, 16:51 #4
This is perfectly legal and semantic:
HTML Code:<h1>Articles</h1> <!-- Unordered List --> <ul>...</ul> <h2>Header</h2> <p>Para...</p> <h2>Header</h2> <p>Para...</p> <h2>Header</h2> <p>Para...</p> <!-- Unordered List --> <ul>...</ul>
-
Oct 15, 2006, 16:53 #5
- Join Date
- Mar 2005
- Location
- Orem, UT
- Posts
- 65
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is it legal that I find this humorous?
Visit Creative Something, my creativity blog.
-
Oct 15, 2006, 16:58 #6
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Use H1 for the nav instead then.
HTML Code:<h1>Articles</h1> <h2>Order Menu</h2> <ul>...</ul> <h2>Article 1</h2> ... h2 content (article 1) <h2>Article 2</h2> ... h2 content (article 2) <h2>Article 3</h2> ... h2 content (article 3) <!-- end of Articles section --> <h1>Navigation Menu</h1> <ul>...</ul>
Edit:
I don't quite understand what you mean about the Order Menu section, but if you think it's separate from the Articles section then place it outside that section...:HTML Code:<h1>Order Menu</h1> <ul>...</ul> <!-- end of Order Menu section --> <h1>Articles</h1> <h2>Article 1</h2> ... h2 content (article 1) <h2>Article 2</h2> ... h2 content (article 2) <h2>Article 3</h2> ... h2 content (article 3) <!-- end of Articles section --> <h1>Navigation Menu</h1> <ul>...</ul>
Simon Pieters
-
Oct 15, 2006, 17:00 #7
- Join Date
- Feb 2005
- Location
- Oregon, USA
- Posts
- 414
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Huh? Either it's a really up there in the ozone concept, or a load of road apples trying to be expressed. Not enough explanation presented to really mean anything.
Released under the Fiasco Labs Digital Damnation Copywright,
it's yours to make whatever the 7734 you want with it.
(c) 2005 Fiasco Labs All Wrongs Reserved
-
Oct 15, 2006, 17:01 #8
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
oh wait, i think i see now what aqw was trying to say
that last UL doesn't really "belong" to the last H2, it "belongs" to the entire page (i.e. the H1)
unfortunately, html just isn't up to this challenge
i cannot see any nice way of solving this semantic question, unless that new SECTION tag might do the trick
my advice, aqw, is to forget it, let it be, and go in search of some other problems to solve
-
Oct 15, 2006, 18:39 #9
- Join Date
- Oct 2005
- Location
- Brisbane, QLD
- Posts
- 4,067
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by r937
-
Oct 15, 2006, 19:09 #10
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Exactly.
Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Oct 15, 2006, 22:47 #11
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The last H2 (Navigation Menu) should be present, but may be hidden with CSS. The extra H2 for the 'order menu' should not be necessary, IMHO.
Birnam wood is come to Dunsinane
-
Oct 16, 2006, 00:13 #12
- Join Date
- Mar 2006
- Location
- Yorkshire, UK
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by zcorpan
Technology is dominated by two types of people:
those who understand what they do not manage,
and those who manage what they do not understand.
-
Oct 16, 2006, 00:29 #13
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by blain
Simon Pieters
-
Oct 16, 2006, 00:51 #14
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
rule #1 of holes: when you find yourself in a hole, stop digging
all this nonsense of trying to make something "semantically correct" is only making it worse and worse
Hx tags are semantically broken, they do not "include" the stuff that comes after them, so let's admit it and move on to some other problem
-
Oct 16, 2006, 02:34 #15
- Join Date
- Sep 2006
- Location
- Nottingham, UK
- Posts
- 3,133
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Maybe it should include the stuff...
HTML Code:<h1 heading="headinghere"> content that goes under the h1 </h1>
-
Oct 16, 2006, 03:47 #16
- Join Date
- Dec 2004
- Location
- Derbyshire - UK
- Posts
- 2,651
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by zcorpan
<h1>'s should only appear once on a page and should be the page title so if more than one is being used then it is probably being used incorrectly.
-
Oct 16, 2006, 09:01 #17
- Join Date
- Feb 2003
- Location
- eez
- Posts
- 331
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Summary of the post
Thanks all for your answers... I voluntarily made this post a little provocative to heat up the debate. I really didn't want to offend anyone. Sorry if I did.
Summary:
1/ It is a time waster to try to semantically define the "area" or "section" of a heading element <hn>. Hopefully the <section> element will solve this. That's not for tomorrow though.
2/ Situation: A <hn> heading followed by a top element (ex: explaining paragraph, etc.), middle elements (preceded by <hn-1>s), and a bottom element (nav bar, etc.).
The top element doesn't need a <hn-1> simply because when a user is on the <hn> element, the user will see it (Supposing the <hn> heading is on 1 line or otherwise very short). The bottom element, however, needs a <hn-1> heading simply because the preceding and last article can be very long. The nav bar won't be visible when over the last article's <hn-1> in that case. Therefore, it needs an <hn-1> heading also.
Moreover, the bottom element needs a <hn-1> heading to clearly indicate that it's not part of the preceding article. (That argument will no longer be valid when the <section> element will have become standard though).
Thanks for reading.
P.S.
agw - Sorry no offence but thats the biggest load of cr@p ive read since joining SP
-
Oct 16, 2006, 09:08 #18
- Join Date
- May 2003
- Location
- Cambridge, UK
- Posts
- 2,366
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by r937
A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.
There are six levels of headings in HTML with H1 as the most important and H6 as the least. Visual browsers usually render more important headings in larger fonts than less important ones.
The following example shows how to use the DIV element to associate a heading with the document section that follows it. Doing so allows you to define a style for the section (color the background, set the font, etc.) with style sheets.
Code:<DIV class="section" id="forest-elephants" > <H1>Forest elephants</H1> <P>In this section, we discuss the lesser known forest elephants. ...this section continues... <DIV class="subsection" id="forest-habitat" > <H2>Habitat</H2> <P>Forest elephants do not live in trees but among them. ...this subsection continues... </DIV> </DIV>
Code:<h1>Articles</h1> <h2>Order Menu</h2> <ul>...</ul> <div id="articles"> <h2>Article 1</h2> ... h2 content (article 1) <h2>Article 2</h2> ... h2 content (article 2) <h2>Article 3</h2> ... h2 content (article 3) </div> <!-- end of articles div --> <h2>Navigation Menu</h2> <ul>...</ul> // end of <h1>
Last edited by Buddy Bradley; Oct 16, 2006 at 09:10. Reason: indent code
-
Oct 16, 2006, 09:16 #19
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Headings in HTML 'work' exactly the same as they do in normal typography. They provide a very brief summary of the content that follows, until the next heading at the same or higher structural level.
Birnam wood is come to Dunsinane
Bookmarks