Random spaces in CSS/PHP layout.

Discussion in 'HTML & Website Design' started by csc1990, Dec 13, 2011.

  1. #1
    So here's the deal. I'm designing this web site using PHP includes for the header and footer. Everything is CSS and DIV based, no tables. My deadline was Friday at 5pm and this is for my employer, not a freelance job. So needless to say, this is starting to look very bad on me that I can't seem to solve this problem. The only thing keeping me from being able to launch the site is this unexpected space being added in for some reason.

    http://trtc.us/1 <--This is what I'm working with.

    If you would like to have the files to look at in your own editor and work with, here is where you can download the zip with my CSS/images/php files. (Hosted on my own hosting, not Sharecash or anything.)


    I really need help with this.
     
    csc1990, Dec 13, 2011 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    What's worse is your whole site is non-compliant. You don't have a doctype and are in quirks mode. Getting you out of quirks, where you never want to be, will probably change everything around. Add this to your first line and see whether everything gets moved around on you:

    <!DOCTYPE html>

    If so, you are in for a world of hurt.
     
    drhowarddrfine, Dec 13, 2011 IP
  3. csc1990

    csc1990 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Not at all. Nothing changed!
     
    csc1990, Dec 13, 2011 IP
  4. Toycel

    Toycel Peon

    Messages:
    243
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    0
    #4
    Hello fella,

    Just having a quick look at the code I am bewildered as to why you have the external CSS stylesheet referenced in your <head> and in the content of your page (above your footer div).

    If you PM me I can have a look for you.

    Thanks in advance,
    Toycel
     
    Toycel, Dec 13, 2011 IP
  5. csc1990

    csc1990 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Alright guys. I ended up just giving up on my own coding and used a generator. =/ How mature of me.

    So this is what I'm looking at now.

    I have a few small problems that I believe will be pretty easy to fix with the right eye.

    The first and most important one is the obviously distorted footer. If I can get that straightened up I can launch today!
    The other minor and not so important things are the un-alignment of my header elements as opposed to the content box and the small space below the header image over the navigation bar.

    Once again, thank you guys!
     
    csc1990, Dec 13, 2011 IP
  6. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #6
    Obviously distorted? Not obvious to me.
     
    drhowarddrfine, Dec 13, 2011 IP
  7. Toycel

    Toycel Peon

    Messages:
    243
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    0
    #7
    To me in Chrome the footer is behind the header!?
     
    Toycel, Dec 13, 2011 IP
  8. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #8
    Yeah, I saw that. The markup is just goofy.
     
    drhowarddrfine, Dec 13, 2011 IP
  9. pennywise711

    pennywise711 Member

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #9
    think this is the first site that has two body tags :)
     
    pennywise711, Dec 13, 2011 IP
  10. pennywise711

    pennywise711 Member

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #10
    Rewritten it a bit and changed it to something readable :)

    index.html (or php if you will use includes)
    
    <!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>
    <title>Touhstone Ranch</title>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" type="text/css" href="main.css" />
    
    <style type="text/css">
    <!--
    .style1 {color:#3c2e15}
    -->
    </style>
    </head>
    
    <body>
    
    
    <div id="wrapper">
    <h1 class="tollFree">Call Now: (254) 918-2009 or toll free (877) 271-6777</h1>
    
    <div id="header"></div>
    
        
    <div id="navigation">
        <ul>
        <li><a href="index.php">Home</a></li> 
        <li><a href="programs.php">Treatment Programs</a></li>
        <li><a href="pictures.php"> Pictures</a></li>
        <li><a href="testimonials.php">Testimonials</a></li>
        <li><a href="about.php"> About Us</a></li> 
    	<li><a href="http://equinetherapytexas.com">Blog</a></li>
        </ul>
    </div>
    
    <div id="leftColumn">LEFTSIDE</div>
    
    <div id="rightColumn">RIGHTSIDE</div>
    
    <div id="footer">
      <ul>
        <li><a href="index.php">Home</a></li> 
        <li><a href="programs.php">Treatment Programs</a></li>
        <li><a href="pictures.php"> Pictures</a></li>
        <li><a href="testimonials.php">Testimonials</a></li>
        <li><a href="about.php"> About Us</a></li> 
    	<li><a href="http://equinetherapytexas.com">Blog</a></li>
      </ul>
    <p>2011 Touchstone Ranch Recovery Center</p>
    <p>P.O. Box 1519 Stephenville, Texas 76401</p>
    </div>
    
    </div>
    
    </body>
    </html>
    Code (markup):
    main.css changed the name for the css file

    @charset "utf-8";
    /* CSS Document */
    
    /* Reset */
    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { 
    	margin:0;
    	padding:0;
    }
    table {
    	border-collapse:collapse;
    	border-spacing:0;
    }
    fieldset,img { 
    	border:0;
    }
    address,caption,cite,code,dfn,em,strong,th,var {
    	font-style:normal;
    	font-weight:normal;
    }
    ol,ul {
    	list-style:none;
    }
    caption,th {
    	text-align:left;
    }
    h1,h2,h3,h4,h5,h6 {
    	font-size:100%;
    	font-weight:normal;
    }
    q:before,q:after {
    	content:'';
    }
    abbr,acronym { border:0;
    }
    
    /* Layout */
    body {background:url(images/bg.png) 0 0 repeat;}
    
    #wrapper {
    	width:960px;
    	background:url(images/callBg.png) 0 0 repeat-x;
    	margin:0 auto;
    	overflow:auto;	
    	}
    
    #header {
    	height:165px;
    	width:960px;
    	background:url(images/head.png) 0 0 no-repeat; 
    	margin-top:25px;	
    	}
    
    #navigation {
    	background:url(images/callBg.png) 0 0 repeat-x;
    	height:33px;
    	width:960px;
    	padding-top:1px;
    	margin:6px 0;
    	}
    
    #leftColumn {
    	clear:both;
    	float:left;
    	position:relative;
    	width:700px;
    	height:400px;
    	background-color:#00FFCC;
    	}
    	
    #rightColumn {
    	float:right;
    	position:relative;
    	width:250px;
    	height:400px;
    	background-color:#06C;	
    	}
    
    #footer {
    	clear:both;
    	width:960px;
    	height:60px;
    	background:#FFFFCC;
    	}
    	
    /*fonts*/
    body { 
    	font-family:Georgia, "Times New Roman", Times, serif;
    	color:#3c2e15;
    	text-align:center;}
    
    .tollFree { 
    	font-size:26px;
    	color:#FFFFFF;
    	font-style:italic;
    	margin-top:4px;
    	}
    
    /*styling*/
    #navigation ul, #footer ul {
    	list-style:none;
    	position:relative;
    	margin-top:5px;
    	text-align:center;
    }
    
    #navigation ul li, #footer ul li {
    	display:inline;
    	margin-left:20px;
    }
    
    #navigation ul li a {
    	color:#FFFFFF;
    	font-weight:bold;
    	font-size:18px;
    }
    
    #navigation ul li a {
    	color:#FFFFFF;
    	font-size:12px;
    }
    
    #navigation ul li a:hover {color:#457991;}
    #navigation ul li a:focus {color:#0C0;}
    Code (markup):
     
    pennywise711, Dec 13, 2011 IP
  11. pennywise711

    pennywise711 Member

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #11
    few quick remarks

    changed callnow.png to callBg.png -> cut it a bit smaller and have typed the text in top banner (can sent you the file if u need it, or just cut it up in photoshop yrself)

    changed nav.png and used callBg.png -> nav.png wasnt wide enough

    the meta tags arent complete, but didnt know if you already had those or not

    if you want you can nest rightColumn in leftColumn, but dont really see a reason to do so
     
    pennywise711, Dec 13, 2011 IP