1 Replies - 1605 Views - Last Post: 19 February 2008 - 01:42 PM

#1 BakaTanuki   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-February 08

How to keep content fixed between sidebars

Post icon  Posted 19 February 2008 - 01:38 PM

I am making a gaming website with embedded Blogger as my blogging platform. I am very inexperienced with web development, and am learning as I go along. I am using dreamweaver to create my site. My problem is that some users are reporting problems with the blog going "under" the sidebars with certain browsers and monitor sizes. I assume this is common knowledge and easily solved by someone with more knowledge in the field. What do I need to do to have the blog stay fixed between the sidebars at all times?

That page's 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"><!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Gaming Dungeon</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<style type="text/css"> 
<!-- 
body  {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #000000;
	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: #ffffff;
}

/* Tips for this Hybrid layout
1. Since the side columns em-based sizing is based on the user's default font size, you will want to be sure that background graphics in the columns take that into account. Built correctly, this is more accessible for those that need larger font sizes, since the width of the columns remains proportionate. If this is undesirable with your design, simply change the width to a pixel size and be sure to change the margins on the #mainContent div accordingly.
2. Since the sizing of side columns in this layout are based on the 100% font size in the body element, if you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the column widths will downsize proportionately. You may want to increase their widths, and the size of the #mainContent div's side margins, to compensate for this.
3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
4. The #container div is not necessary for this layout at the 100% width. You may want to use it to create faux columns or limit the width of the layout.
5. It is not neccessary to have the 100% width on the #container div since, by nature, a div takes up 100% of the available space. It is here so that if you want to decrease the size of the overall container - perhaps leaving a bit of margin on each side - this will already be available for adjustment.
*/
.thrColHybHdr #container { 
	width: 100%;
	background: #000000;
	/*margin: 0 auto;  the auto margins (in conjunction with a width) center the page if needed */
	text-align: left; /* this overrides the text-align: center on the body element. */
}  
.thrColHybHdr #header { 
	background: #DDDDDD; 
	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. */
} 
.thrColHybHdr #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. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width. 
3. 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 ".thrColHybHdr #sidebar1 p" rule.
*/
.thrColHybHdr #sidebar1 {
	float: left; 
	width: 11em; /* since this element is floated, a width must be given */
	background-image: "../images/RedPanel.jpg"; /* the background color will be displayed for the length of the content in the column, but no further */
	padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.thrColHybHdr #sidebar2 {
	float: right; 
	width: 11em; /* since this element is floated, a width must be given */
	background-image: "../Images/RedPanel.jpg"; /* the background color will be displayed for the length of the content in the column, but no further */
	padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.thrColHybHdr #sidebar1 h3, .thrColHybHdr #sidebar1 p, .thrColHybHdr #sidebar2 p, .thrColHybHdr #sidebar2 h3 {
	margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
	margin-right: 10px;
}

/* Tips for mainContent:
1. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
2. 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.
3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
*/
.thrColHybHdr #mainContent {
 	margin: 0 12em 0 12em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */ 
	padding: 0 2em 0 2em; /* padding here creates white space "inside the box." */
} 
.thrColHybHdr #footer { 
	padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background:#660000;
} 
.thrColHybHdr #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 */
.thrColHybHdr #sidebar1, .thrColHybHdr #sidebar2 { padding-top: 30px; }
.thrColHybHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>

<body class="thrColHybHdr">

  <div id="sidebar1">
	<p align="center">
	  <!-- end #sidebar1 -->
	  <img src="images/MainMenu_button.gif" alt="Menu" width="142" height="47" /><img src="http://gamingdungeon.ikrell.com/images/SideBarMap.gif" alt="Sidebar" width="142" height="362" border="0" usemap="#Map" />
<map name="Map" id="Map"><area shape="rect" coords="1,1,141,40" href="http://gamingdungeon.ikrell.com/index.php" alt="home" />
<area shape="rect" coords="1,40,141,77" href="http://gamingdungeon.ikrell.com/webpages/Site.php" alt="Site" />
<area shape="rect" coords="0,77,145,114" href="http://z15.invisionfree.com/Gaming_Dungeon/" alt="forum" />
<area shape="rect" coords="-2,116,144,154" href="http://gamingdungeon.ikrell.com/webpages/Reviews.php" alt="reviews" />
<area shape="rect" coords="-1,155,143,191" href="http://gamingdungeon.ikrell.com/webpages/Articles.php" alt="articles" />
<area shape="rect" coords="-1,191,144,222" href="http://gamingdungeon.ikrell.com/webpages/Projects.php" alt="projects" />
<area shape="rect" coords="-1,222,145,257" href="http://gamingdungeon.ikrell.com/webpages/Creative.php" alt="Creative" />
<area shape="rect" coords="-1,258,155,291" href="http://gamingdungeon.ikrell.com/gallery/" alt="gallery" />
<area shape="rect" coords="-1,291,145,323" href="http://gamingdungeon.ikrell.com/webpages/Videos.php" alt="videos" />
<area shape="rect" coords="-2,323,149,367" href="http://gamingdungeon.ikrell.com/webpages/Podcasts.php" alt="podcasts" />
</map></p>
	<p align="center"><img src="images/Feeds_button.gif" alt="Feeds" width="142" height="47" /></p>
	<p align="center"><a href=http://gamingdungeon.blogspot.com/feeds/posts/default><img src=http://farm1.static.flickr.com/1/277361_abfa082fe3.jpg /></a></p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center"><script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-3650040-1";
urchinTracker();
</script></p>
  </div>
  <div id="sidebar2">
	<h3 align="center"><img src="Images/Features_button.gif" alt="Features" width="142" height="47" /></h3>
	<p align="center"><a href="http://gamingdungeon.blogspot.com/2008/02/gaming-dungeons-2007-gaming-final.html">GD's 2007 gaming final thoughts</a></p>
	<p align="center"><img src="images/Articles_button.gif" alt="Articles" width="142" height="47" /></p>
	<p align="center"><a href="http://gamingdungeon.blogspot.com/2008/02/gaming-dungeons-2007-gaming-final.html">What is an adventure game?</a></p>
	<p align="center"><a href="http://gamingdungeon.blogspot.com/2008/02/gaming-dungeons-2007-gaming-final.html">GD's 2007 gaming final thoughts</a>
	<p align="center"><img src="images/Reviews_button.gif" alt="Reviews" width="142" height="47" />
	<p align="center"><a href="http://gamingdungeon.blogspot.com/2008/02/enjoy-everything.html">Yotsuba&amp;! Volume 1 Review</a></p>
	<p align="center"><a href="http://gamingdungeon.blogspot.com/2008/02/super-mario-galaxy-review.html">Super Mario Galaxy Review</a></p>
	<p align="center"><a href="http://gamingdungeon.blogspot.com/2008/02/sugar-sugar-rune.html">Sugar Sugar Rune Review</a></p>
	<p align="center"><img src="images/Podcasts_button.gif" alt="Podcasts" width="142" height="47" /></p>
	<p align="center">coming soon</p>
	<p align="center"><img src="images/Videos_button.gif" alt="Videos" width="142" height="47" /></p>
	<p align="center">coming soon</p>
	<p align="center"><img src="images/Affiliates.gif" alt="Affiliates" width="142" height="47" /></p>
	<p align="center"><a href="http://batsrpg.blogspot.com/"><img src="http://i236.photobucket.com/albums/ff233/lwelyk/Egam1.png" alt="BATS RPG" width="89" height="29" /></a></p>
	<p align="center"><a href="http://www.freewebs.com/animangasite/"><img src="http://img.photobucket.com/albums/v466/Tangy418/uwhi.png" alt="Animangasite" width="88" height="33" /></a></p>
	<p align="center"><a href="http://www.zelda101.com/"><img src="http://www.zelda101.com/1012.gif" alt="Zelda101" width="88" height="31" /></a></p>
	<p align="center"><a href="http://www.thenintendobasement.com/"><img src="http://img.photobucket.com/albums/v379/baka-chan/LinktoTNBsmall.jpg" alt="The Nintendo Basement" /></a></p>
	<p align="center"><a href="http://beyond.withinmyworld.org/" target="blank" title="Beyond Battles, a SSB and SSB:M site"><img src=http://beyond.withinmyworld.org/Images/SiteStuff/bb6.jpg /></a> </p>
	<p align="center"><a href="http://spp.withinmyworld.org/' target="_blank" title="Umbrella Angel, a Super Princess Peach fansite"><img src=http://spp.withinmyworld.org/images/site/link2.gif></a></p>
	<p align="center"><a href="http://lwelyk-legos.blogspot.com/"><img src="http://img.photobucket.com/albums/v379/baka-chan/LegoAffbutton.png"></a></p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">&nbsp;</p>
	<p align="center">
	  <!-- end #sidebar2 -->
	</p>
  </div>
  <div id="mainContent">
	<h1 align="center"><!-- end #mainContent -->
	</h1>
  </div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
   <!-- InstanceBeginEditable name="EDIT" -->
<center><iframe src="http://gamingdungeon.blogspot.com/" width="900" height="2000" frameborder="0">
<div align="center">alternative content for browsers which do not
  support iframe
</div>
</iframe></center>
 <!-- InstanceEndEditable --><br class="clearfloat" />
   <div id="footer">
	<p align="center">&copy; Gaming Dungeon</p>
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
<!-- InstanceEnd --></html>



Thanks in advance for any help.

Is This A Good Question/Topic? 0
  • +

Replies To: How to keep content fixed between sidebars

#2 capty99   User is offline

  • i am colt mccoy
  • member icon

Reputation: 99
  • View blog
  • Posts: 10,081
  • Joined: 26-April 01

Re: How to keep content fixed between sidebars

Posted 19 February 2008 - 01:42 PM

whats the page's address?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1