PDA

View Full Version : Bringing a sidebat down through a footing.


sebrown00
06-16-2009, 02:36 AM
I have been attempting to put everyone's replies to work,thank you.
I'm sure all you dreamweaver experts stiil see many an error in my code but I'm attempting to work on it.

My site is www.sbrownarchitects.com (http://www.sbrownarchitects.com). On the template in sidebar 1, the orange is supposed to go down to the bottom of the footer. The phone number and email address should be at the bottom. In dreamweave I have managed to bring it down to the top of the footer using margins. But, this does not show up when viewed on the browser. Why? Also, I have no clue how to carry the orange/ sidebar down to the bottom of the footer.

Also why does the navigation text turn white when viewed in the browser? Its black in dreamweaver? I feel a tad clueless, so many questions and any advice would be appreciated. Thanks once again!

Code is below.
<!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>
<style type="text/css">
<!--
/**zeros out browsers defaults on everything**/
* {margin: 0; padding:0; line-height: 100%; border: 0;}
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
text-align: center;
color: #000000;
background-color: #CCC;
}
#container {
width: 1000px;
background: #666;
margin: 12px auto; /* the auto margins (in conjunction with a width) centers the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
color: #333;
}
.navigation {
font-family: Verdana, Geneva, sans-serif;
font-size: 18px;
font-style: normal;
color: #333;
text-decoration: none;
font-weight: bold;
}
.h4 {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
font-style: italic;
line-height: normal;
margin:200px;
}
.h5 {
font-family: Verdana, Geneva, sans-serif;
font-size: 18px;
font-style: italic;
line-height: normal;
margin:200px;
}
#header {
background: #DDDDDD;
padding: 0px;
}
#header h1 {
margin: 0;
padding: 10px 0;
color: #000;
}
/* Tips for sidebars:
1. Since we are working in percentages, it's best not to use side padding on the sidebars. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".thrColLiqHdr #sidebar1 p" rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*/
#sidebar1 {
float: left; /* this element must precede in the source order any element you would like it be positioned next to */
width: 22%; /* since this element is floated, a width must be given */
background: #F90; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 5px 0; /* top and bottom padding create visual space within this div */
overflow: hidden; /*IE float drop fix*/
color: #333;
}
#sidebar2 {
float: right; /* this element must precede in the source order any element you would like it be positioned next to */
width: 40%; /* since this element is floated, a width must be given */
background: #666; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 25px 0; /* top and bottom padding create visual space within this div */
color: #000;
margin-right: 10px;
}
#sidebar1 p, #sidebar1 h3, #sidebar2 p, #sidebar2 h3 {
font-size: 14px;
padding: 10px;
color: #333;
}
address {font-size: 14px;line-height: 1.5; font-weight:bold; padding: 450px 480
px;}
#mainContent p, #mainContent h3 {
line-height: 1.5;
font-size: 18px;
padding: 32px;
margin-left: 10px;
}

#mainContent {
margin: 0 5% 0 22%; /* 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. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */
}
#footer {padding: 0 10px; background:#666; color: white;
}
#footer p {margin: 0; padding: 2px 0; text-align: right; font-size: 14px;
}
/* Miscellaneous classes for reuse */
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
/* BEGIN Vertical List Menu */
#navlist-vert
{
padding-left: 0;
margin-left: 0;
border-bottom: 1px solid gray;
width: 100%;
font-size: 14px;
}
#navlist-vert li
{
list-style: none;
margin: 0;
padding: 0.25em;
border-top: 1px solid gray;
}
#navlist-vert li a {
text-decoration: none;
display:block;
font-weight: bold;
line-height: 2em;
}
#navlist-vert li a:link {color:#333333}
#navlist-vert li a:visited { color:#FFFFFF}
#navlist-vert li a:hover, #navlist-vert li a:active, #navlist-vert li a:focus {
color:#333;
background: gray;
}
</style>
-->
</style>
<!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.thrColLiqHdr #sidebar2, .thrColLiqHdr #sidebar1 { padding-top: 30px; }
.thrColLiqHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--><br class="clearfloat" />
</head>
<body>
<div id="container">
<div id="sidebar1">
<p>&nbsp;</p>
<div id="navlist-vert">
<ul>
<li><a href="index.html" class="navigation">Home</a></li>
<li><a href="../about.html" class="navigation">About</a></li>
<li><a href="/Portfolio.html" class="navigation">Work</a></li>
<li><a href="../people.html" class="navigation">People</a></li>
</ul>
</div> <!--end navlist -->
<address>646-244-5870<br />
sbrownarch@gmail.com </address>

</div>
<!--end sidebar1 -->
<!-- TemplateBeginEditable name="text" -->
<div id="sidebar2">
<p>Sidebar2 </p>
<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 the #mainContent div will always contain more content than the #sidebar2 div. </p>
<p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fer</p>
</div>
<!-- TemplateEndEditable --><!-- TemplateBeginEditable name="images" -->
<div id="mainContent">
<h3><img src="../images/webimages/thumbnails/COMPRESSED/shakerblackandwhite.jpg" width="100" height="113" /></h3>
<h3><img src="../images/webimages/thumbnails/COMPRESSED/shakerblackandwhite.jpg" width="100" height="113" />Donec eu mi sed turpis feugiat feugiat. In</h3>
</div>
<!-- TemplateEndEditable -->
<br class="clearfloat" />
<div id="footer">
<p>&nbsp;</p>
<p>
<img src="../images/webimages/thumbnails/COMPRESSED/monticelloblackandwhite.jpg" alt="image" width="118" height="112" />
<img src="../images/webimages/thumbnails/COMPRESSED/shakerblackandwhite.jpg" alt="image" width="95" height="112" />
<img src="../images/webimages/thumbnails/COMPRESSED/tagblackandperspect1.jpg" alt="image" width="145" height="112" />
<img src="../images/webimages/thumbnails/COMPRESSED/fieldstonblackandwhite.jpg" alt="image" width="220" height="112" />
<img src="../images/webimages/thumbnails/COMPRESSED/tagelevblackandwhiteco.jpg" alt="image" width="153" height="112" /></p>
<!-- end #footer --></div>
</p></div>
<!-- end #container --></div>
</body>
</html>

DWcourse
06-16-2009, 03:25 PM
But an orange background image in the container style that matches the width and color of your menu. Repeat it y-only.

isabel
07-11-2013, 04:20 PM
I've gone through a lot of posts but I still can't get my sidebar to stretch to the footer. Please help.

Here is my 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 -->
<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;
background-color: #5B5B5B;
}
.twoColLiqLtHdr #container {
width: 100%; /* this will create a container 80% of the browser width */
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. */
}
.twoColLiqLtHdr #header {
background: #c0c0c0;
padding: 0 10px; /* 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. */
}
.twoColLiqLtHdr #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 */
}
/* Tips for sidebar1:
1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*/
.twoColLiqLtHdr #sidebar1 {
float: left;
width: 15%;
border: 0;
background-image: url(../Graphics/sidebar.jpg);
background-repeat: repeat-y;
padding-top: 15px;
padding-right: 0;
padding-bottom: 15px;
padding-left: 0;
}
.twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
margin-left: 5px; /* the left and right margin should be given to every element that will be placed in the side columns */
margin-right: 5px;
}
/* Tips for mainContent:
1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
*/
.twoColLiqLtHdr #mainContent {
margin: 0 10px 0 20%; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
}
.twoColLiqLtHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#c0c0c0;
text-align: center;
}
.twoColLiqLtHdr #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 */
}
/* Miscellaneous classes for reuse */
.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;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
.twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<style type="text/css">
<!--
h1 {
color: #000;
}
h2 {
color: #000;
}
-->
</style>
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>
<body class="twoColLiqLtHdr">
<div id="container">
<div id="header">
<h1><img src="../Graphics/OAGHeader1.bmp" alt="OAG Header" /></h1>
<!-- end #header --></div>
<div id="sidebar1">
<h3>&nbsp;</h3>
<ul id="MenuBar1" class="MenuBarVertical">
<li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
<ul>
<li><a href="#">Item 1.1</a></li>
<li><a href="#">Item 1.2</a></li>
<li><a href="#">Item 1.3</a></li>
</ul>
</li>
<li><a href="#">Item 2</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
<ul>
<li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
<ul>
<li><a href="#">Item 3.1.1</a></li>
<li><a href="#">Item 3.1.2</a></li>
</ul>
</li>
<li><a href="#">Item 3.2</a></li>
<li><a href="#">Item 3.3</a></li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
</ul>
<!-- end #sidebar1 --></div>
<div id="mainContent"><!-- TemplateBeginEditable name="Content" -->
<h1 align="center">Special</h1>
<p align="center">&nbsp;</p>
<table border="0" cellspacing="1" cellpadding=".5" width="100%">
<tbody>
<tr>
<td><span id="sec1"><font color="#0000FF"><strong id="title_note">PURPOSE</strong></font></span></td>
<td valign="center" align="right">&nbsp;</td>
</tr>
</tbody>
</table>
<p><span id="sec1">This guide does not replace policy, procedures, or training
</span></p>
<!-- TemplateEndEditable -->
<p>&nbsp;</p>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<h5> Home Page</h5>
<!-- end #footer --></div>
<!-- end #container --></div>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>

gentleone
07-12-2013, 07:25 PM
There are quite some ways to deal with this. Each has its own pros & cons.
http://www.vanseodesign.com/css/equal-height-columns/