Results 1 to 15 of 15

Thread: <!doctype ...> what does it mean?

  1. #1
    Join Date
    Apr 2005

    <!doctype ...> what does it mean?

    I created a CSS drop-down menu, all are fine.

    parent-child sections are used in CSS, look like:
    #parent > child{...}
    #parent:hover > child{...}
    Actually, the menu code was copied from somewhere then modified by me.
    At beginning of the html page, I see:
    <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd">
    then, I reduce the code to:
    <!doctype >
    All are still fine.
    But, menu doesn't work if without last <!doctype >.

    I am wondering why the piece of code <!doctype > is so important? it sounds saying nothing.

    Could you explain?



  2. #2
    Join Date
    Feb 2008
    NW Washington State
    The DOCTYPE describes to the Web browser displaying the page which set of rules to use when parsing (reading and displaying) the page.
    So using one set of rules will display one way. Using a different set of rules means the page will display some other way.
    More info here:
    Best wishes,
    Eye for Video

  3. #3
    Join Date
    Mar 2011
    To put a finer point on this issue, the <!DOCTYPE> is particularly important to web designers because using a complete <!DOCTYPE> statement sets browsers to Standards Compliance Mode in which they are all at least *trying* to render pages according to the W3C Standards. Using an incomplete <!DOCTYPE> or omitting it entirely, leaves browsers in what's called "Quirks Mode" in which they render pages with their own methods - each of which is different to one degree or another. Simply put, if your page relies on anything more sophisticated than <table>s and <font> tags, a complete <!DOCTYPE> is vital for cross-browser compatibility.
    Rick Trethewey
    Rainbo Design

  4. #4
    Join Date
    Apr 2005
    My question is not clear.

    does the blank <!doctype > include default version, link or something else?

  5. #5
    Join Date
    Mar 2011
    Your example "<!doctype>" is invalid and does nothing. Browsers will use Quirks Mode if you use that. Use a complete <!DOCTYPE> that includes the document type and a URL so that the browser will use Standards Compliance Mode. For example:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    Rick Trethewey
    Rainbo Design

  6. #6
    Join Date
    Jan 2011
    No, that's not true.
    The <!doctype> declaration will enforce all browsers to go into standards HTML mode. Same as with the script tag which will always default to its native "JavaScript" language not some other random or unconventional programming language if not declared.

    Only the most recent FX edition seems to have introduced a bug, which makes it complain. But they seem to have forgotten that the default browser language (and the reason they exist) is was and always will be: HTML code interpretation.

    Anyway until FX reverts to complying with the convention they always complied to, going with <!DOCTYPE html> declaration will do you no harm.

  7. #7
    Join Date
    Feb 2008
    NW Washington State
    Troy III, I suggest you re-read the other posts.

  8. #8
    Join Date
    Apr 2012
    Just choose a specification you are going to follow and use its doctype - http://www.w3schools.com/tags/tag_DOCTYPE.asp

    If "HTML 4.01 Transitional" doesn't dork, try "XHTML 1.0 Transitional" I believe they are most popular now.

  9. #9
    Join Date
    Mar 2012
    Basically: If it was working fine with the HTML 4.01 doctype why change it??? Or if you must fiddle, read the manual!

  10. #10
    Join Date
    Nov 2002
    Quote Originally Posted by jedaisoul View Post
    Basically: If it was working fine with the HTML 4.01 doctype why change it??? Or if you must fiddle, read the manual!
    And if one is going to change it to the more recent HTML 5 version, at least make sure it's correct, <!DOCTYPE HTML>.

  11. #11
    Join Date
    Mar 2012
    Quote Originally Posted by spufi View Post
    And if one is going to change it to the more recent HTML 5 version, at least make sure it's correct, <!DOCTYPE HTML>.
    I've been thinking about 5, but how well supported is that?

  12. #12
    Join Date
    Nov 2002
    It mostly needs tweaks for IE(surprise) but I think it's doable. You still need to learn were to put stuff as some of the tag aren't as straight forward as you think they should be. <section>, <aside>, <header>, and <footer> are good examples of tags that have flexibility. I would definitely read up on it to help sort it out. I'm going through a book on it and making a mock up from what I learn. There is also a number of technologies that are getting lumped into HTML 5 as well. The Missing Manual series has a HTML 5 book that covers the topics and it's the one I'm going through.

    Here's the basics of code to make it more cross browser friendly. I might add I could see adding the <video> and <audio> tags as block level display as well.

    Put into <head> as IE doesn't even recognize the HTML 5 tags and this counters it.
    <!--[if lt IE 9]>
        <script src="http://html5shim.googglecode.com/svn/trunk/html5.js"></script>
    Put into CSS. Some browsers don't give these tags block level display.
    /* HTML 5 Block Tags */
    article, aside, figure, figcaption, footer, header, hgroup, nav, section {

  13. #13
    Join Date
    Mar 2012
    Thanks for the advice.

  14. #14
    Join Date
    Jan 2011
    Quote Originally Posted by Eye for Video View Post
    Troy III, I suggest you re-read the other posts.
    I suggest you read mine alone.

  15. #15
    Join Date
    Feb 2012
    Bokaro Steel City (Jharkhand), India!
    I am in love with HTML5! <3
    HTML Code:
    <!doctype html>
    Last edited by TheAliveWinner; 05-03-2012 at 09:48 AM.
    "It will never rain roses: when we want to have more roses, we must plant more roses." - George Eliot

Thread Information

Users Browsing this Thread

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

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.11035 seconds
  • Memory Usage 3,005KB
  • Queries Executed 13 (?)
More Information
Template Usage (35):
  • (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
  • (5)bbcode_code
  • (1)bbcode_html
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)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 (70):
  • 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_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
  • 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_display_complete
  • memberaction_dropdown
  • 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