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
    New to the CF scene
    Join Date
    May 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Help with doctype

    So basically, I was designing a page and recently found out I need to add a doctype. When I add it, it squishes everything to the top, how do I fix it, thanks.


    solved
    Last edited by VIPStephan; 05-05-2012 at 08:57 AM. Reason: added “resolved” title prefix

  • #2
    New Coder
    Join Date
    May 2012
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post
    Please show your code or a link to your problem.

  • Users who have thanked feinburgrl for this post:

    dopeness (05-05-2012)

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by feinburgrl View Post
    Please show your code or a link to your problem.
    -websiteremoved-

    See how everything is up at the top? It should have a header, a content page, and a footer. How can i fix this?
    Last edited by dopeness; 05-05-2012 at 08:52 AM.

  • #4
    New Coder
    Join Date
    May 2012
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    </body>
    </html>

  • #5
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    945
    Thanks
    0
    Thanked 129 Times in 128 Posts
    Frameset Doctypes are not for actual document.

    They are only for Framesets like:

    Code:
    <frameset cols="*,*">
    <frame src="left.htm">
    <frame src="right.htm">
    </frameset>
    which defines which documents to display in the window and how to arrange them.

    use:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    instead.


    @Feinburgrl: Don't instruct a coder, that are so noob, that they do not know the difference between doctypes, to use xHtml.
    It is too advanced at their level.
    Last edited by Lerura; 05-05-2012 at 05:34 AM.

  • #6
    New to the CF scene
    Join Date
    May 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Guys it's not working....

  • #7
    New to the CF scene
    Join Date
    May 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    nevermind, problem fixed, thanks everyone.
    Last edited by dopeness; 05-05-2012 at 08:52 AM.

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello dopeness,
    #container and <div id="Container"> are two different things - see how one is capitalized and one isn't?

    If you give the body of the document a dimension, your #container can base it's size off that. In this example, I've made html, body the height of the viewport -
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type = "text/css">
    html, body {
    	margin: 0;
    	height: 100%;
    }
    #container {
    	position:relative;
    	height:100%;
    	width:100%;
    	background-color:#EBEBEB;
    	border:5px solid red;
    }
    #topLine {
    	height:50px;
    	width:100%;
    	background-color:#000000;
    }
    #header {
    	height:100px;
    	width:100%;
    	background-color:#C0C0C0;
    	border-bottom:groove #cccccc;
    }
    #content {
    	height:60%;
    	width:50%;
    	position:relative;
    	margin:auto;
    	margin-top:80;
    	background-color:#CCCCCC;
    	border:groove #Ebebeb;
    }
    #footer {
    	height:100px;
    	width:100%;
    	background-color:#000000;
    	text-align:center;
    	margin-top:20px;
    }
    </style>
    </head>
    <body>
        <div id="container">
            container
            <div id="topline">			
            </div>						
            <div id="header">			
            </div>			
            <div id="content">			
            </div>			
            <div id="footer">			
            </div>			
        </div>
    </body>
    </html>
    It looks like maybe you're trying to build a full hieght layout. See this demo for some more help.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #9
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,666
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    Quote Originally Posted by Lerura View Post
    use:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    Correction: You should only use a strict doctype when you’re creating a new document.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


  •  

    Posting Permissions

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