SitePoint Sponsor

User Tag List

Results 1 to 21 of 21
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    Cornwall, UK
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OLs and the deprecation of the "type" attribute

    Just a general query I wanted to throw out to the forum...

    I have just been given a Word document which contains the Terms & Conditions our legal department have just drawn up for a new eCommerce website. In addition to a few headings and paragraphs, most of the content has been broken down into ordered lists (numberic and alpha-numeric), sub-lists and (in one or two cases) sub-sub-lists.

    While I am happy to format up the document as XHTML, one thing has struck me - the "type" attribute for ordered-lists has now been deprecated.

    I'm a big supporter of seperating content from design, but deprecating this attribute seems a little odd to me - in this particlar case, the style of each bulletpoints is vital to understanding the content, e.g. it will often state "... see section b" or "... refer to Section 2, sub-section iii for more information...".

    I know I could use CSS to format the bullet-points to the required style, but without the stylesheet, the document is fairly meaningless.

    Does anyone have any suggestions or examples of how they have overcome a situation like this? For now I have simply formatted the headings and made everything else a paragraph.
    Web Services Developer - Cornflower Design

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,721
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Hi Rye .

    I would make them an anchor. Such as <a href="#section2">
    <h1 name="section2"> and then once you click on the link it would take you to the <h1> with the name of "section2". I haven't specifically been in this situation but that is probably how I would handle it.

    Cheers.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    name in most tags is also deprecated - you should be using id for the anchor points.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Consider whether it's actually lists you should use at all. If it's sections, maybe you should just use <h2>Section 2</h2> instead.
    Simon Pieters

  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,721
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Hi .

    Ok name is depreciated too but I couldn't remember what is to be used in place of it. Good thing you were here .
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  6. #6
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    Hi .

    Ok name is depreciated too but I couldn't remember what is to be used in place of it. Good thing you were here .
    Depreciated?

    You mean Deprecated...

    hehe

  7. #7
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,721
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)


    To Stephen yes, to me no. I'll probably use ID more now though (what little I use of it).
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  8. #8
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Consider whether it's actually lists you should use at all. If it's sections, maybe you should just use <h2>Section 2</h2> instead.
    Off Topic:


    @zcorpan

    Is wrapping anchors around block level elements in the working draft for html5?

    Code HTML4Strict:
    <a href="#">
        <h2>...</h2>
        .....
    </a>

  9. #9
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,721
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I just did a quick scan and I didn't see anything definitive. I'd say no because that just wouldn't make sense to me.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  10. #10
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    I just did a quick scan and I didn't see anything definitive. I'd say no because that just wouldn't make sense to me.

  11. #11
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,721
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Edit-I went through W3's site. (Who can understand that ).
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  12. #12
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by rye View Post
    refer to Section 2, sub-section iii for more information...".
    That text will break as soon as you insert another entry into the list above the one referenced - something that is perfectly valid to do. All the sections will then be automatically renumbered exactly as an ordered list is supposed to work. If the numbers themselves have meanings other than the list ordering itself - as it does if you are referencing them from elsewhere - then you should be inserting those numbers into the content yourself and not relying on the list to generate them.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  13. #13
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    The default numbers of the ordered lists are not part of the source code either, so you will not be able to count on them being available under any circumstance. The user might also have set up the default list style to something other than numbers. Therefore, you have two options: Either write the number as part of the list item, and use list-style: none for ordered lists (see below - inline styles used for illustrative purposes only), or use internal links. I would suggest the former, even if it will result in double numbers in some older browsers.

    Code html4strict:
    <ol style="list-style: none;">
      <li>1. This is item one</li>
      <li>2. This is item two</li>
        <ol style="list-style: none;">
          <li>I. This is item 2.I</li>
          <li>II. This is item 2.II</li>
        </ol>
      </li>
    </ol>
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  14. #14
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    Is wrapping anchors around block level elements in the working draft for html5?

    Code HTML4Strict:
    <a href="#">
        <h2>...</h2>
        .....
    </a>
    Simon Pieters

  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 C. Ankerstjerne View Post
    I would suggest the former, even if it will result in double numbers in some older browsers.

    Code html4strict:
    <ol style="list-style: none;">
      <li>1. This is item one</li>
      <li>2. This is item two</li>
        <ol style="list-style: none;">
          <li>I. This is item 2.I</li>
          <li>II. This is item 2.II</li>
        </ol>
      </li>
    </ol>
    Whether you get double numbers is not a function of the age of the browser... You can disable CSS or maybe you're blind and using a screen reader.

    I'd rather suggest using <ul>.
    Simon Pieters

  16. #16
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    I don't mean to sound like a troll, but it's times liek this I wish SitePoint had a "bang head against wall" smiley.

    Seriously, who's idea was this?

  17. #17
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    I don't mean to sound like a troll, but it's times liek this I wish SitePoint had a "bang head against wall" smiley.

    Seriously, who's idea was this?
    Off Topic:


    I think it was Eric Meyer's idea, and Bruce is carrying it out. Again, I am not sure, just assuming. http://meyerweb.com/eric/thoughts/20...rt-and-html-5/

  18. #18
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    Off Topic:


    I think it was Eric Meyer's idea, and Bruce is carrying it out. Again, I am not sure, just assuming. http://meyerweb.com/eric/thoughts/20...rt-and-html-5/
    Off Topic:

    Yeah, Eric was probably the one driving the issue most, leading to the change, although there have been lots of requests for this from various people (although most of them were asking for "global href").
    Simon Pieters

  19. #19
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    Hi .

    Ok name is depreciated too but I couldn't remember what is to be used in place of it. Good thing you were here .
    The 'name' attribute is not deprecated except on the 'applet' element, which is itself deprecated. The confusion arises because it is not a part of the general entity &#37;attrs, consisting of the entities %coreattrs, %i18n, and %events.

    To apply to an element, the 'name' attribute must be specifically allowed. For example, it is allowed on 'a', but not 'h1'. In your example, the 'h1' should have had an 'id' attribute. Had you used the target form of 'a', it could have had 'name'. e.g.
    Code:
    <h1><a name="section2"></a>Section 2</h1>
    The 'name' attribute is required on 'map' and most form controls.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  20. #20
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Whether you get double numbers is not a function of the age of the browser... You can disable CSS or maybe you're blind and using a screen reader.

    I'd rather suggest using <ul>.
    <ul> would not be semantically correct if the order of the list is important (which is will often be in legal documents). If we have to seperate presentation from structure, it means we should ignore the default rendering of the HTML, including the numbers in an ordered list.

    It is furthermore my understanding that far from all screen readers actually read the numbers out loud, as they are not a part of the document text. As for disabling CSS, those who do that should be prepared for a somewhat different user experience than those who has CSS. At any rate, even if the numbers are presented twice, there would be no ambiguity.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  21. #21
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    <ul> would not be semantically correct if the order of the list is important (which is will often be in legal documents). If we have to seperate presentation from structure, it means we should ignore the default rendering of the HTML, including the numbers in an ordered list.
    I agree.

    While the ordering is important and an <ol> is therefore the correct choice, the numbering is not necessarily going to be sequential. A legal document will not renumber all the sections when a section is added or deleted. Section 10 is not necessarily the tenth section if sections have been added or removed earlier in the document. Those section numbers are therefore a part of the content of the list items and not a part of the structure of the list.

    The numbers that display as the defaults for an ordered list are the position of the entry within the list (structure) which is not necessarily the section number (content).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •