Results 1 to 9 of 9

Thread: CSS positioning help please - Dreamweaver template

  1. #1
    Oh right, Ted koocha's Avatar
    Join Date
    Dec 2003
    Location
    East Yorkshire
    Posts
    1,783
    Thanks
    34
    Thanked
    44 times in 24 posts
    • koocha's system
      • Motherboard:
      • Fujitsu D2778-c1
      • CPU:
      • Intel Xeon W3656
      • Memory:
      • 12GB Triple Channel DDR3
      • Storage:
      • 512GB Crucial MX100 SSD, 3 x 3TB mechanicals
      • Graphics card(s):
      • 2GB NVIDIA GeForce GTX680
      • PSU:
      • 500w Fujitsu
      • Case:
      • Fujitsu M470-2
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 42" LG Smart 3D TV
      • Internet:
      • 76Mb BT Infinity 2

    CSS positioning help please - Dreamweaver template

    Hi all

    I'm using the following Dreamweaver template to create a site:

    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" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <style type="text/css"> 
    <!-- 
    body  {
    	font: 100% Verdana, Arial, Helvetica, sans-serif;
    	background: #666666;
    	margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    	padding: 0;
    	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    	color: #000000;
    }
    .thrColAbsHdr #container { 
    	position: relative; /* adding position: relative allows you to position the two sidebars relative to this container */
    	width: 780px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
    	background: #FFFFFF;
    	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    	border: 1px solid #000000;
    	text-align: left; /* this overrides the text-align: center on the body element. */
    } 
    
    /* Tips for absolutely positioned sidebars with header and footer:
    1. Absolutely positioned (AP) elements must be given a top and side value, either right or left. (As a default, if no top value is given, the AP element will begin directly after the last element in the source order of the page. This means, if the sidebars are first element in the #container in the document's source order, they will appear at the top of the #container even without being given a top value. However, if they are moved later in the source order for any reason, they'll need a top value to appear where you desire.
    2. Absolutely positioned (AP) elements are taken out of the flow of the document. This means the elements around them don't know they exist and don't account for them when taking up their proper space on the page. Thus, an AP div should only be used as a side column if you are sure the middle #mainContent div will always contain the most content. If either sidebar were to contain more content, that sidebar would run over the bottom of the parent div, and in this case the footer as well, and the sidebar would not appear to be contained.
    3. If the above mentioned requirements are met, absolutely positioned sidebars can be an easy way to control the source order of the document.
    4. If the source order is changed, the top value should be equal to the height of the header since this will cause the columns to visually meet the header.
    */
    .thrColAbsHdr #header { 
    	height: 60px; /* if you're changing the source order of the columns, you'll may want to use a height on the header so that you can give the columns a predictable top value */
    	background: #DDDDDD; 
    	padding: 0 10px 0 20px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
    } 
    .thrColAbsHdr #header h1 {
    	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
    	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
    }
    .thrColAbsHdr #sidebar1 {
    	position: absolute;
    	top: 60px;
    	left: 0;
    	width: 150px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
    	background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
    	padding: 15px 10px 15px 20px; /* padding keeps the content of the div away from the edges */
    }
    .thrColAbsHdr #sidebar2 {
    	position: absolute;
    	top: 60px;
    	right: 0;
    	width: 160px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
    	background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
    	padding: 15px 10px 15px 20px; /* padding keeps the content of the div away from the edges */
    }
    .thrColAbsHdr #mainContent { 
    	margin: 0 200px; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. */
    	padding: 0 10px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
    }
    .thrColAbsHdr #footer { 
    	padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
    	background:#DDDDDD;
    } 
    .thrColAbsHdr #footer p {
    	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
    	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    }
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    	float: right;
    	margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page */
    	float: left;
    	margin-right: 8px;
    }
    --> 
    </style><!--[if IE 5]>
    <style type="text/css"> 
    /* place css box model fixes for IE 5* in this conditional comment */
    .thrColAbsHdr #sidebar1 { width: 180px; }
    .thrColAbsHdr #sidebar2 { width: 190px; }
    </style>
    <![endif]--></head>
    
    <body class="thrColAbsHdr">
    
    <div id="container">
      <div id="header">
        <h1>Header</h1>
      <!-- end #header --></div>
      <div id="sidebar1">
      <h3>Sidebar1 Content</h3>
        <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if it will always contain more content. </p>
        <p>Donec eu mi sed turpis feugiat feugiat. Integer</p>
        <p> turpis arcu, pellentesque  eget, cursus et, fermentum ut, sapien. </p>
        <!-- end #sidebar1 --></div>
      <div id="sidebar2">
        <h3>Sidebar2 Content</h3>
        <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. </p>
        <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque  eget, cursus et, fermentum ut, sapien. </p>
      <!-- end #sidebar2 --></div>
      <div id="mainContent">
        <h1> Main Content </h1>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. </p>
        <h2>H2 level heading </h2>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo</p>
        <p> pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
        <!-- end #mainContent --></div>
      <div id="footer">
        <p>Footer</p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    </body>
    </html>
    the problem I have it that the side bars cover the footer when they get longer.

    The only thing I want it to do is move the footer down as the side bars get bigger, as the main content does, but I can't figure out how to do it.

    Any help would be appreciated.

    Thanks

  2. #2
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: CSS positioning help please - Dreamweaver template

    Actually that won't work, you've got some crazy CSS there.

    Code:
    <!-- Unverified, untested -->
    </div>
      <br clear="all" /> or <br style="clear:both;" /> or <style type="text/css">.clr { clear: both; } </style><br class="clr" />
      <div id="footer">
      <p>Footer</p>
    Last edited by yamangman; 19-01-2008 at 04:48 PM.
    To err is human. To really foul things up ... you need a computer.

  3. #3
    Oh right, Ted koocha's Avatar
    Join Date
    Dec 2003
    Location
    East Yorkshire
    Posts
    1,783
    Thanks
    34
    Thanked
    44 times in 24 posts
    • koocha's system
      • Motherboard:
      • Fujitsu D2778-c1
      • CPU:
      • Intel Xeon W3656
      • Memory:
      • 12GB Triple Channel DDR3
      • Storage:
      • 512GB Crucial MX100 SSD, 3 x 3TB mechanicals
      • Graphics card(s):
      • 2GB NVIDIA GeForce GTX680
      • PSU:
      • 500w Fujitsu
      • Case:
      • Fujitsu M470-2
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 42" LG Smart 3D TV
      • Internet:
      • 76Mb BT Infinity 2

    Re: CSS positioning help please - Dreamweaver template

    Hi

    Thanks for the reply.

    I can't seem to get any of the 3 suggestions working :-/

  4. #4
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: CSS positioning help please - Dreamweaver template

    Yea i figured above, heh.
    To err is human. To really foul things up ... you need a computer.

  5. #5
    Oh right, Ted koocha's Avatar
    Join Date
    Dec 2003
    Location
    East Yorkshire
    Posts
    1,783
    Thanks
    34
    Thanked
    44 times in 24 posts
    • koocha's system
      • Motherboard:
      • Fujitsu D2778-c1
      • CPU:
      • Intel Xeon W3656
      • Memory:
      • 12GB Triple Channel DDR3
      • Storage:
      • 512GB Crucial MX100 SSD, 3 x 3TB mechanicals
      • Graphics card(s):
      • 2GB NVIDIA GeForce GTX680
      • PSU:
      • 500w Fujitsu
      • Case:
      • Fujitsu M470-2
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 42" LG Smart 3D TV
      • Internet:
      • 76Mb BT Infinity 2

    Re: CSS positioning help please - Dreamweaver template

    Quote Originally Posted by yamangman View Post
    Yea i figured above, heh.
    Sorry? think I've missed something...

  6. #6
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: CSS positioning help please - Dreamweaver template

    Quote Originally Posted by yamangman View Post
    Actually that won't work, you've got some crazy CSS there.

    Code:
    <!-- Unverified, untested -->
    </div>
      <br clear="all" /> or <br style="clear:both;" /> or <style type="text/css">.clr { clear: both; } </style><br class="clr" />
      <div id="footer">
      <p>Footer</p>
    ^^^^ wont let me post without some text
    To err is human. To really foul things up ... you need a computer.

  7. #7
    Oh right, Ted koocha's Avatar
    Join Date
    Dec 2003
    Location
    East Yorkshire
    Posts
    1,783
    Thanks
    34
    Thanked
    44 times in 24 posts
    • koocha's system
      • Motherboard:
      • Fujitsu D2778-c1
      • CPU:
      • Intel Xeon W3656
      • Memory:
      • 12GB Triple Channel DDR3
      • Storage:
      • 512GB Crucial MX100 SSD, 3 x 3TB mechanicals
      • Graphics card(s):
      • 2GB NVIDIA GeForce GTX680
      • PSU:
      • 500w Fujitsu
      • Case:
      • Fujitsu M470-2
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 42" LG Smart 3D TV
      • Internet:
      • 76Mb BT Infinity 2

    Re: CSS positioning help please - Dreamweaver template

    Ah, I did miss that!

    That's the default code Dreamweaver gave me for the template...

  8. #8
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: CSS positioning help please - Dreamweaver template

    Well they're a bunch of buggers. The absolute positioning will cause you more trouble than it's worth in the long run. I'd recommend switching to a float style layout right now.

    Three Column Layouts - css-discuss
    To err is human. To really foul things up ... you need a computer.

  9. #9
    Oh right, Ted koocha's Avatar
    Join Date
    Dec 2003
    Location
    East Yorkshire
    Posts
    1,783
    Thanks
    34
    Thanked
    44 times in 24 posts
    • koocha's system
      • Motherboard:
      • Fujitsu D2778-c1
      • CPU:
      • Intel Xeon W3656
      • Memory:
      • 12GB Triple Channel DDR3
      • Storage:
      • 512GB Crucial MX100 SSD, 3 x 3TB mechanicals
      • Graphics card(s):
      • 2GB NVIDIA GeForce GTX680
      • PSU:
      • 500w Fujitsu
      • Case:
      • Fujitsu M470-2
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 42" LG Smart 3D TV
      • Internet:
      • 76Mb BT Infinity 2

    Re: CSS positioning help please - Dreamweaver template

    Thanks for the tip. I still want a fixed width though for all 3 columns, just want a footer to move down with everything else

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. divs and CSS
    By Kezzer in forum Software
    Replies: 11
    Last Post: 18-11-2003, 12:51 PM
  2. CSS aid
    By Iain in forum Software
    Replies: 1
    Last Post: 14-10-2003, 11:40 PM
  3. CSS + Other Language Questions
    By Jonny M in forum Software
    Replies: 7
    Last Post: 11-10-2003, 11:17 PM
  4. CSS Help
    By Basher in forum Software
    Replies: 19
    Last Post: 10-09-2003, 08:13 PM

Posting Permissions

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