SitePoint Sponsor

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 25 of 61
  1. #1
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    London
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <div id="footer> is NOT semantic. Discuss.

    This is a subject came out of another thread. We're discussing whether this...

    HTML Code:
    <div id="footer">...</div>
    ... can be considered to be "semantic."

    I say "nay". Let battle commence!
    Last edited by GaryS; Jul 3, 2006 at 15:28. Reason: Syntax correction

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    i agree, it isn't

    but more than that, it's not even valid (the closing quote is missing)

    tsk tsk, eh
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    London
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by r937
    it's not even valid (the closing quote is missing)
    Good catch: corrected now.

  4. #4
    SitePoint Addict
    Join Date
    Mar 2005
    Location
    Toronto
    Posts
    378
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would actually say that it is semantic. The whole point of being "semantic" to me is to expect the non-coders to understand what a specific tag is supposed to represent. In this case, it would be fairly obvious that the div tag contains the footer. If that's the original intent anyway

  5. #5
    SitePoint Zealot erikwebb's Avatar
    Join Date
    Dec 2003
    Location
    Atlanta, GA
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By giving the <div> a name, you're making it semantic. Way better that the good ole days of using <font> and <p> tags to represent everything except headers.

    --Erik

  6. #6
    SitePoint Wizard bronze trophy bigalreturns's Avatar
    Join Date
    Mar 2006
    Location
    The Wirral, England
    Posts
    1,293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree with OP,the div is not semantic. Saying that something is in a div never conveys any meaning about what its content might be. The id="footer" is the semantic part of the markup, but the <div> tag itself isnt.
    "The proper function of man is to live - not to exist."
    Get a Free TomTom


  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    i agree, it is not semantic

    "semantic" in the context of markup implies that a machine can figure out what it means, and the semantics of DIV is empty

    yes, a human being looking at id="footer" can ascribe meaning, but that's not the same thing, is it

    id="foo" has exactly the same meaning as id="footer" (and it's shorter, too )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I never said <div class="footer"> was semantic, that wasn't the original question.

    I said that whenever HTML doesn't have a semantic element for the intended purpose (in this case, a footer), then a div may be used instead. That doesn't mean that divs are semantic. As I said in the original thread:
    Quote Originally Posted by zcorpan
    [...]UAs can't extract any semantics from divs or spans (unless, perhaps, if an HTML profile is used)[...]
    The answer to this question is no, a div doesn't carry any semantics (again, unless an HTML profile is used).
    Simon Pieters

  9. #9
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    London
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Point of clarification:

    Quote Originally Posted by zcorpan
    (again, unless an HTML profile is used).
    What is an HTML profile?

  10. #10
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,361
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Surely it all depends on what you have in your footer...

  11. #11
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If it's not semantic, that's fine and all, but only XML would really be semantic.

    <leftcolumn></leftcolumn>
    <footeratbottomofpage></footeratbottomofpage>
    <alittlecheatididtogetthebackgroundtolookright></alittlecheatididtogetthebackgroundtolookright>

    Semantic or not, I'll stick with div. The web is lightyears behind coding standards, and even spelling, let alone semantics.

    Also, just to note...


    If I had to define a document that said something to the effect that:

    <leftcolumn> extends <div>

    So that in my code, I could USE <leftcolumn> and it would behave in the manner of a div, well, I'd gouge my eyes out; because I'd feel at that point, people are demanding critical micromanagement of the information. And that's why I never got into the SIM series.

  12. #12
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well.. the question I have to ask here is "Why does it matter?". I mean, we can go on this all day, but I'd like to see the point of why we're going on this all day

  13. #13
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by chris_fuel
    "Why does it matter?"
    that's easy -- a machine (e.g. a search engine bot) can figure out what a TITLE is, what an H1 is, which words/phrases to give more weight to via STRONG and EM, and so on

    DIVs being meaningless, it cannot extract any meaning from them

    that's why
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  14. #14
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you know to check by id of footer you can. You just have to use a standard dom getElementById function, or there's the xpath query "//[@id='footer']", or you can just parse all nodes of the tree and say:

    "I am a " + node.getAttribute('id')

    or you could make a <footer> tag, you'd just have to have an xsl stylesheet which converts it to html for the browser to actually render. Attributes are a part of an element just as much as the name iteself.. in fact the id attribute was created with the logic in mind of uniquely identifying elements though something besides a tag name. Search engine bots may just choose to ignore such attributes, doesn't mean that they technically can't.

  15. #15
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GaryS
    What is an HTML profile?
    Meta data profiles

    aaron.martone, your custom XML has no semantics at all. No UA would be able to understand what your elements mean. And even so, your element names seem to suggest presentation rather than meaning.
    Simon Pieters

  16. #16
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You want meaning then. Lets see you nail that in an custom XML tag with less than 20 words. Meaning.... Can you get any more vague?

    Semantics can take a backseat to coding standards. Get the net to XHTML/CSS compliance before we start to nitpick whether XML tags should define meaning that can differ on a person to person basis.

  17. #17
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Location
    Utrecht, The Netherlands
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi All,

    You make a valid point in questioning the semantics of <div id="footer">. Not so much because using a div is non-semantic, because it is. The div element has a meaning, and although it is often being misused by people who are new to css and tableless layouts, it can well be used to divide your document into meaningful sections.

    It is true that browsers and other machines do not assign any special qualities to the div element. If however, there are no specific html elements available that represent the content well, you can best put the content in a "div" tag and assign a meaningful id to it. Using an id is enough for most practical purposes however and it gives the human reader a good idea of what the information is about. The thing is: I do not think the word "footer" is very appropriate or semantic. It doesn't say anything about the content of the div. It only says something about the position the content will have on the page. More often than not, the footer contains information that could be labeled "colophon". Using "colophon" says way more (to a human) about what to expect inside the div. Also, when you want to move the information to another position on the page, you can do it by changing te stylesheet, whereas the word "footer" says it should be at the foot of the page, i.e. at the bottom, so you would also have to alter the html on all of your pages to something that is more appropriate for the new layout. All in all, I think you shouldn't use id's or classes such as "footer", "header", "top_bar", "side_column", etc.

    Well, I guess you get the point. You should assign id's and classes that actually represent the content and not the presentation (or behaviour) of that content.

    Best regards,
    Martijn Senden.
    Last edited by Sendeman; Jul 4, 2006 at 02:05.

  18. #18
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    excellent point, martijn
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  19. #19
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Location
    Utrecht, The Netherlands
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I think SEO and other machine-oriented coding should always take a backseat to the accessibility and usablity for human users, and hence, semantics. Don't get me wrong: it can be important to optimise your site for search engines and such. It just shouldn't have any negative effects on usablity for the human users, that's all. They are the ones that you want to see again on your site, be friendly to them, rather than burden them with a bunch of out of place keywords (or anything like that).

  20. #20
    SitePoint Addict
    Join Date
    Mar 2005
    Location
    Toronto
    Posts
    378
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sendeman
    All in all, I think you shouldn't use id's or classes such as "footer", "header", "top_bar", "side_column", etc.
    I do agree with the majority of your remarks. However, I must say that I do not agree with this. For us, being developers, ids such as "footer", "header" are much much more conventional and easier to intepret than ids such as "colophon". We as developers should care more about the presentation (where the objects are placed) rather than information. And ids such as "footer", "header" would be perfect choices for this reason. Being a developer, we do not need to know what kind information the div contains but rather how this div is presented to the audience. Your audience will not look at your code, but rather you will. It is much more important for you to realize that your logo image in placed in the #header section (meaning the top of your page) rather than #logo_image section without knowing where the image is. And besides, footers and headers also help the next person who will be maintaining/reconstructing your design

  21. #21
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by kefeso
    We as developers should care more about the presentation (where the objects are placed) rather than information.
    disagree most strongly
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  22. #22
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    London
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Want to pick up on a couple of Sendeman's points:

    Quote Originally Posted by Sendeman
    Well, I guess you get the point. You should assign id's and classes that actually represent the content and not the presentation (or behaviour) of that content.
    Entirely agree.

    But is is slightly off-topic, as "semantic or no" is in the eyes of the user, not the developer. (It's clearly an emotive subject, judging by some of the other posts. New thread anyone?)

    **************

    Quote Originally Posted by Sendeman
    You make a valid point in questioning the semantics of <div id="footer">. Not so much because using a div is non-semantic, because it is. The div element has a meaning, and although it is often being misused by people who are new to css and tableless layouts, it can well be used to divide your document into meaningful sections.
    I must say you've swayed me somewhat. I can just about be pursuaded that a div has a semantic meaning, though that meaning is limited to "here's a chuck of content that belongs together, that is separate in some way from the content that goes before and that which comes after." As long as we don't try to ascribe more meaning than that, I'm on board.

  23. #23
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Location
    Utrecht, The Netherlands
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GaryS
    I can just about be pursuaded that a div has a semantic meaning, though that meaning is limited to "here's a chuck of content that belongs together, that is separate in some way from the content that goes before and that which comes after." As long as we don't try to ascribe more meaning than that, I'm on board.
    I agree, it doesn't have more meaning than that. That's why an id or class is necessary. Always look for a suitable html element that comes closest to the semantics you need. If none is available that's better than the div or the span, the div or span with a semantically suitable id or class is your best option. I'm sorry if my previous post gave the impression that I think the div has as much semantic meaning as say, the h1 element. It doesn't. However, it doesn't have no semantic meaning either.

    Hope that clears things up.

  24. #24
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Location
    Utrecht, The Netherlands
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GaryS
    "semantic or no" is in the eyes of the user, not the developer. (It's clearly an emotive subject, judging by some of the other posts.
    I don't fully agree. Semantics are to some extent emotive, as language often is. However semantics can be approached from a theoretical perspective as well. Here's an extract from Wikipedia on the subject:

    Quote Originally Posted by WIKIPEDIA
    Semantics can be approached from a theoretical as well as an empirical (for example psycholinguistic and neuroscientific) point of view. The decompositional perspective towards meaning holds that the meaning of words can be analyzed by defining meaning atoms or primitives, which establish a language of thought. An area of study is the meaning of compounds, another is the study of relations between different linguistic expressions (homonymy, synonymy, antonymy, polysemy, paronyms, hypernymy, hyponymy, meronymy, metonymy, holonymy, exocentric, and endocentric). Semantics includes the study of thematic roles, argument structure, and its linking to syntax. Semantics deals with sense and reference, truth conditions, and discourse analysis. Pragmatics is often considered a part of semantics, but otherwise is treated as a branch of its own.

  25. #25
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    homonymy, synonymy, antonymy, polysemy, paronyms, hypernymy, hyponymy, meronymy, metonymy, holonymy, exocentric, and endocentric
    sounds like a law firm
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •