Results 1 to 8 of 8

Thread: XHTML 1.0 Strict Validation error, I don't understand

  1. #1
    Join Date
    Jun 2007

    Question XHTML 1.0 Strict Validation error, I don't understand

    I attached a screenshot for simplicity.
    This screenshot is less compressed than the attachment: here:

    I'm not sure what this error is telling me. This code was taken right from the HTML, XHTML & CSS sixth edition Elizabeth Castro book. Although she used Transitional, which works across Firefox, IE, Chrome. However, when I use Strict, it works fine in Firefox, and Chrome, but IE 8 ignores the styles. However, I think the last issue is more related to IE being thrown into corks mode. So I would naturally use transitional for this.

    But with regard to strict 1.0 I don't understand this error.
    Attached Images Attached Images
    Last edited by waveform; 03-10-2013 at 08:40 PM.

  2. #2
    Join Date
    Jun 2007
    I passed the validation by adding P tags around the links. But I don't understand why they were needed.
    I think links are inline elements, and I know you can't add block level elements to inline, but that was not the case.
    There was nothing else on the page, just the links themselves. So why do they need to be enclosed in some type of block level element? Is that the rule for XHTML strict 1.0?

    <a href="home.html">home</a>
    <a href="about.html">about</a>
    <a href="examples.html">examples</a>
    <a href="extras.html">extras</a>
    <a href="opinions.html">opinions</a>
    <a href="help.html">help</a>
    Last edited by waveform; 03-10-2013 at 11:21 PM.

  3. #3
    Join Date
    Jul 2003
    The City of Roses
    According to the spec, only block elements -- not inline -- can be direct children of the body.

  4. #4
    Join Date
    Jun 2007
    Thank you Jeff for the direct and precise explanation.
    I should probably put some time into reading the specs. I was kind of hesitant on reading any WC3's explanations at this point. I find many technical spec documentation difficult to understand because of how they word things. (same difficult situation with reading Linux Man pages when you're new..lol) But you're explanation was priceless and very clear. Thank you!

    At the moment I've just been working out of a book, and watching videos here-and-there. What I find odd is, the book I'm using recommends only writing clean strict code, yet "all" the doc types through out the book use transitional. It is a great book, but I was surprised it didn't mention this. and I've been scanning the chapters front to back.

    Thanks again for the help Jeff!
    Last edited by waveform; 03-11-2013 at 05:13 PM.

  5. #5
    Join Date
    Mar 2013
    Another fix that would work is to set the hyperlinks themselves to be block elements in the CSS:

    a { display: block; }

    This way your XHTML markup remains the same as before, and is less cluttered, and you just have a little extra CSS. Saves a little bandwidth.

    Personally I find some of the rules for 'strict' to be a bit arbitrary to be honest. I've often encountered similar validation errors and much as I can normally figure out what rules I'm breaking, I don't really understand the justification for having those rules anyway. They seem to be driven more by some kind of dogma than by practical considerations. I tend to stick to transitional these days rather than strict as life is too short to waste on arbitrary formatting issues just to keep the w3c validator happy.

  6. #6
    Join Date
    Jun 2007
    Good tip, Thank you Flack
    I do recall recently reading about changing an element with display, but didn't understand the books explanation for what it was used for.
    However, it makes perfect sense in the context you mentioned. Good to know.

    I know how you feel with regard to complying with strict. I notice most pages still use transitional which Is fine I guess for most pages. On the other hand, according to my book titled: Xhtml css 6 Elizabeth Castro, it says in order to take advantages of things like databases, you have to use strict. SQL databases is really the reason for me learning PHP. Though I have seen pages with database's and forms using Transitional, I don't really know what limitations one would run into by not using strict, so I figured I would just take the long way and learn it. But somethings do seem redundant. I have much to learn still.

    Thanks again, Flack and Jeff! - Much appreciated!
    Last edited by waveform; 03-18-2013 at 01:09 AM. Reason: spelling

  7. #7
    Join Date
    Mar 2013
    You don't need to use XHTML strict or any other particular flavour of HTML to use databases, it has no bearing or effect on how a site integrates with a database. It may have an effect on how the data you pull from a database displays, but that is true of any data on a page whether it came from a database or not. As long as your HTML can be parsed by a browser so it can see what form fields you're passing, then it really doesn't matter what HTML format you use. The form handler receives the same input, and the database process happens the same as it would whether your page is displaying in XHTML strict, transitional or quirks mode even.

    The most important thing if you're getting into databases is to read up on SQL injection and how to avoid it, i.e. parametrized queries and stored procedures. This is what you need to know before you start working with online databases, regardless of what scripting platform or database you're using. You don't want your first knowledge of SQL injection to be after your first site gets hacked!

  8. #8
    Join Date
    Jun 2007
    Thanks again Flack.
    I've actually put SQL off to the side for the moment to focus on CSS and PHP. But that's good to know. After you mentioned that the other night, I ran though the security section of my SQL books and they have whole sections dedicated to injections. I'm just not there yet. But security is going to be a major concern at some point. I'll keep this in the back of my head.

    By the way,
    At the moment, I'm keeping templates with comments of all the things I'm learning. However, although I have memorized a lot with regard to syntax rules, ..and even structuring things like basic css selectors, I often have to keep going back to reference my notes on certain property names, or sometimes I'll forget how to structure something. I sometimes wonder if I have a bad memory or if it's just that I'm still new to this. I spend a lot of time studying the rules. I guess at this point, I need to just make up projects for myself and it will sink in. Like the doc type for example, I just copy and paste that. If I don't make myself memorize it, I'll never remember it.
    Last edited by waveform; 03-19-2013 at 08:17 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10025 seconds
  • Memory Usage 2,934KB
  • Queries Executed 16 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (8)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (75):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • fetch_postattach_query
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates