SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Is the placement of <!DOCTYPE vital?

  1. #1
    SitePoint Zealot Krieger's Avatar
    Join Date
    Dec 2003
    Location
    Nevada - USA
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is the placement of <!DOCTYPE vital?

    Hello.

    I'm using a template from Paul O'Brien (see CSS forum), but have a question about the

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    statement at the top of the page (and many other webpages as well).

    If I place that statement before my <html> tag, the page (which normally fits 100% of the viewscreen) will scroll just a tiny bit - no matter what I change.

    If I put the <!DOCTYPE... statement AFTER the <html> tag is stops the scrolling.

    Is the placement order of the statement in any way vital?

    Can someone direct me to a good resource for the purpose of the <!DOCTYPE... statement?

    Any input would be appreciated.
    Verwüstung rufen und des Krieges Hund' entfesseln!

    My Site
    My first php/MySQL project -->Thanks Sitepoint members

  2. #2
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2003
    Posts
    6,849
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    Maybe this will help. Hope it does.

    http://www.w3schools.com/xhtml/xhtml_dtd.asp

    Later
    Johnny

  3. #3
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the doctype MUST be at the beginning of the document...nowhere else.

    if you're getting an extra bit of scrolling, that's then a CSS issue to solve.
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  4. #4
    SitePoint Zealot Krieger's Avatar
    Join Date
    Dec 2003
    Location
    Nevada - USA
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the response. I'll check into it.
    Verwüstung rufen und des Krieges Hund' entfesseln!

    My Site
    My first php/MySQL project -->Thanks Sitepoint members

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
  •