Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jan 2011
    Posts
    302
    Thanks
    7
    Thanked 0 Times in 0 Posts

    html5 validation problem

    http://www.countyfairgrounds.net/rodeos/hirearodeo.php

    There are 12 errors on this page, (from the html5 validator) - the css3 validates. I do NOT understand what the validator is asking me to do with lines 538, 558, or line 566.
    There are three other errors below that on the validator page also.
    This datatable is NOT displaying properly on the page either.
    The errors with the "&" problem I DO understand - but they would not be affecting the display of the page. Please please I need help.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    Element style not allowed as child of element div in this context.
    A style element must be in the header of the document, not in the body.

    The element section must not appear as a descendant of the th element.
    What’s unclear about that? For the proper use of section refer to http://html5doctor.com/the-section-element/

    And what is this anyway?
    Code:
    <table class="contenttable">
    
    <tr>
    <th scope="col">
    <section class="eventname">
    Professional Rough Stock Riders Association</section><br /><br />
    </th>
    </tr>
    <section class="sociallinks">
    <A href="http://http://www.facebook.com/profile.php?id=1846">Facebook</A>
    </section>
    <br />
    <br />
    <tr>
    <td>
    Why is there a section (and line breaks) in between table rows? Even plain logic forbids such markup since nothing can be direct children of tbody (which is always existing implicitly, even if not declared) other than table rows.

  • #3
    Regular Coder
    Join Date
    Jan 2011
    Posts
    302
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Good morning Stephan.

    Part of this

    A style element must be in the header of the document, not in the body.

    Quote:
    The element section must not appear as a descendant of the th element.
    What’s unclear about that? For the proper use of section refer to http://html5doctor.com/the-section-element/

    Herein lies the problem with that: How do I define it then? I can NOT repeat div in the database only can I repeat the section tags. What you are looking at (above ) is the event name and url for the event. Each are different for each listing. So what do I do with this particular thing?

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    Quote Originally Posted by CoolKay View Post

    I can NOT repeat div in the database only can I repeat the section tags.
    Why is that?

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,634
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Have you considered getting rid of the table. It doesn't appear that your content is actually tabular data so it really shouldn't be in a table.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    Regular Coder
    Join Date
    Jan 2011
    Posts
    302
    Thanks
    7
    Thanked 0 Times in 0 Posts
    if I get rid of the table - well, seems it ought to be in a division each section BUT, you can not repeat divisions ids on a page (the validator will not let you) - you can however repeat section ids on a page. I suppose I could do a main section class="mainsection" and put all the sections in it. Let me think on it

  • #7
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    Hi CoolKay,

    Your site's coming along nicely. Those tables are trouble when it comes to page layout. I know first hand.

    Regarding the ids and not using them more than once on a page, that's correct. They're to be used for something unique, when you know you won't have another item like it on that same page.

    Example of an id: Logo (#logo)




    Example of a class: Box headers (.headers)



    The logo is used only once. That could be an "id." The rectangular red headers could be a "class" because they're used again and again. They all look alike; only their inside text changes. As a class they could be used inside a div container for a left or right sidebar. Or, as you have it, a div that has a white background with a black border.

    I hope this helps explain "id" and "class." Tables will let you hit a baseball into right field over the fence. CSS will let you knock the bird off the top of the white flag pole, 20.7 feet passed the fence and 10.1 feet to the left of the green Chevy pickup on the street.

    --Kevin

    .
    Last edited by Kevin_M_Schafer; 01-09-2012 at 11:11 PM. Reason: text clarity
    My keyboard is an IBM from 1993 and I like it that way. | Who is Dan Well? Everyone always says I know Dan Well.Building a web page is like building a birdhouse. Put it up there and watch 'em come. | Maintaining the aspect ratio of an image is more important than having a cold orange pop.

  • #8
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    Quote Originally Posted by CoolKay View Post
    you can not repeat divisions ids on a page (the validator will not let you) - you can however repeat section ids on a page.
    What you say makes no sense. An ID must be unique, regardless of the element it’s assigned to.

    This is a division element:
    Code:
    <div></div>
    and you can have as many as you like.

    This is a division with an ID attribute:
    Code:
    <div id="example"></div>
    You can have more divisions in the document but not the same ID.
    This is allowed:
    Code:
    <div id="example1"></div>
    <div id="example2"></div>
    <div id="another_example_ID"></div>
    This is not allowed:
    Code:
    <div id="example"></div>
    <div id="example"></div>
    <div id="example"></div>
    … and neither is it allowed with section elements (or any element).

    If there are multiple divisions that are supposed to be named alike then assign a class to them. This is allowed at all times, and, again, on any element:
    Code:
    <div class="example"></div>
    <div class="example"></div>
    <div class="example"></div>

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Honestly I would stop trying to code in HTML5 if I were you. IMO I think it would be best if you learned more of the basics of HTML.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Tags for this Thread

    Posting Permissions

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