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 10 of 10
  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Problem with main content not expanding? (Now IE compatiability issue)

    Hey everyone,

    I am having a problem with my site I am working on here:

    www.fellowcitizensmusic.com/press.html

    All my other pages seem to be working fine, but when there is not enough content in the main content div the rounded box does not expand to fit the page and leaves a blank white space to the right. Can anyone help me figure out how to set this so the rounded box will always fill the page no matter how little content is in there?

    As always any help is greatly appreciated, thanks!

    My CSS:
    Code:
    @charset "utf-8";
    body {
    	font: 100% Verdana, Arial, Helvetica, sans-serif;
    	background: #FFF;
    	text-align: center; 
    	color: #000000;
    	margin: 0;
    	padding: 0;
    	font-family: Verdana, Geneva, sans-serif;
    }
    
    .oneColElsCtrHdr #container {
    	border: 1px solid #000000;
    	text-align: left; 
    	background-color: #FFF;
    	margin: auto;
    }
    .oneColElsCtrHdr #header h1 {
    
    }
    .oneColElsCtrHdr #mainContent {
    	background-color: #CCC;
    	padding: 0 40px;
    }
    
    #mainContent {
    	font-family: "Rockwell Extra Bold";
    	font-size: 100%;
    	font-style: normal;
    	color: #FFF;
    	text-align: center;
    	float: none;
    	clear: none;
    	top: 210px;
    	position: absolute;
    	left: 0px;
    }
    #header {
    	background-color: #FFF;
    	top: 0px;
    	background-repeat: repeat-x;
    	left: 0px;
    	width: 100%;
    	height: 60px;
    	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    	background-image: url(../images/Header_Bg2.jpg);
    	overflow: hidden;
    	position: absolute;
    }
    #footer {
    	background-color: #CCC;
    	width: 100%;
    	height: 200px;
    }
    #footer P {
    	color: #FFF;
    	text-align: center;
    }
    
    
    #header ul {
    	list-style-type: none;
    	font-size: 20px;
    	color: #FFF;
    	font-weight: bold;
    	position: absolute;
    	top: 0;
    	clear: right;
    	padding-left: 2.5em;
    	left: 40px;
    	float: left;
    }
    #header li {
    	display: inline;
    	margin-right: 1em;
    	overflow: hidden;
    }
    #header a {
    	font-size: 100%;
    	color: #000;
    	text-decoration: none;
    	padding-top: 2px;
    	padding-right: 15px;
    	padding-bottom: 2px;
    	padding-left: 15px;
    }
    
    
    #masthead {
    	background-position: center;
    	position: absolute;
    	width: 100%;
    	left: 0px;
    	top: 60px;
    }
    .box {
    	background-color: #000;
    	clear: left;
    	height: 100%;
    	width: 100%;
    }
    .boxtop {
    	background-image: url(../images/ne.gif);
    	background-repeat: no-repeat;
    	background-position: right top;
    	text-align: left;
    }
    .boxtop div {
    	background-image: url(../images/nw.gif);
    	background-repeat: no-repeat;
    	background-position: left top;
    	height: 50px;
    	font-size: 0px;
    	width: 50px;
    }
    .boxbottom {
    	background-image: url(../images/se.gif);
    	background-repeat: no-repeat;
    	background-position: right bottom;
    	text-align: center;
    }
    .boxbottom div {
    	font-size: 0px;
    	height: 50px;
    	background-image: url(../images/sw.gif);
    	background-repeat: no-repeat;
    	background-position: left bottom;
    	width: 50px;
    }
    .boxcontent {
      padding: 0px 50px 0px 50px;
    }
    Last edited by JonisJon; 03-02-2009 at 11:23 PM. Reason: Please use code tags in the future

  • #2
    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 JonisJon,
    When you don't give a width to #mainContent it sizes itself to it's content... an odd behavior that seems cause by the absolute positioning? Not sure about that.
    This works to fix it -
    Code:
    #mainContent {
    	font-family: "Rockwell Extra Bold";
    	font-size: 100%;
    	font-style: normal;
    	color: #FFF;
    	text-align: center;
    margin: 210px 0 0 0;
    }
    or this -
    Code:
    #mainContent {
    	font-family: "Rockwell Extra Bold";
    	font-size: 100%;
    	font-style: normal;
    	color: #FFF;
    	text-align: center;
    	top: 210px;
    	position: absolute;
    	left: 0px;
    width: 100%;
    }

    Good job on the valid CSS/XHTML !!
    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

  • #3
    New Coder
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you excavator. I took your code and it didn't work as first, but I just had to adjust a few more small elements, and adjusting the padding of the box to get it to work correctly. Thanks for the help and the nod on the valid code... I made sure to validate everything before i submitted it on here.

  • #4
    New Coder
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts
    However, after I fixed it, is showing up fine in firefox, but all warped in IE. Check out the differences in the apperance, of this link between the two browsers: www.fellowcitizensmusic.com/news.html

    Any ideas on what may be causing this IE bug?

    my updated CSS:

    Code:
    @charset "utf-8";
    body {
    	font: 100% Verdana, Arial, Helvetica, sans-serif;
    	background: #FFF;
    	text-align: center; 
    	color: #000000;
    	margin: 0;
    	padding: 0;
    	font-family: Verdana, Geneva, sans-serif;
    }
    
    .oneColElsCtrHdr #container {
    	border: 1px solid #000000;
    	text-align: left; 
    	background-color: #FFF;
    	margin: auto;
    }
    .oneColElsCtrHdr #header h1 {
    
    }
    .oneColElsCtrHdr #mainContent {
    	background-color: #CCC;
    }
    
    #mainContent {
    	font-family: "Rockwell Extra Bold";
    	font-size: 100%;
    	font-style: normal;
    	color: #FFF;
    	text-align: center;
    	top: 210px;
    	position: absolute;
    	left: 0px;
    	width: 100%;
    }
    #header {
    	background-color: #FFF;
    	top: 0px;
    	background-repeat: repeat-x;
    	left: 0px;
    	width: 100%;
    	height: 60px;
    	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    	background-image: url(../images/Header_Bg2.jpg);
    	overflow: hidden;
    	position: absolute;
    }
    #footer {
    	background-color: #CCC;
    	width: 100%;
    	height: 200px;
    }
    #footer P {
    	color: #FFF;
    	text-align: center;
    }
    
    
    #header ul {
    	list-style-type: none;
    	font-size: 20px;
    	color: #FFF;
    	font-weight: bold;
    	position: absolute;
    	top: 0;
    	clear: right;
    	padding-left: 2.5em;
    	left: 40px;
    	float: left;
    }
    #header li {
    	display: inline;
    	margin-right: 1em;
    	overflow: hidden;
    }
    #header a {
    	font-size: 100%;
    	color: #000;
    	text-decoration: none;
    	padding-top: 2px;
    	padding-right: 15px;
    	padding-bottom: 2px;
    	padding-left: 15px;
    }
    
    
    #masthead {
    	background-position: center;
    	position: absolute;
    	width: 100%;
    	left: 0px;
    	top: 60px;
    }
    .box {
    	background-color: #000;
    	clear: left;
    	height: 100%;
    	width: 90%;
    	left: 60px;
    	position: relative;
    }
    .boxtop {
    	background-image: url(../images/ne.gif);
    	background-repeat: no-repeat;
    	background-position: right top;
    	text-align: left;
    }
    .boxtop div {
    	background-image: url(../images/nw.gif);
    	background-repeat: no-repeat;
    	background-position: left top;
    	height: 50px;
    	font-size: 0px;
    	width: 50px;
    }
    .boxbottom {
    	background-image: url(../images/se.gif);
    	background-repeat: no-repeat;
    	background-position: right bottom;
    	text-align: center;
    }
    .boxbottom div {
    	font-size: 0px;
    	height: 50px;
    	background-image: url(../images/sw.gif);
    	background-repeat: no-repeat;
    	background-position: left bottom;
    	width: 50px;
    }
    .boxcontent {
      padding: 0px 50px 0px 50px;
    }
    Last edited by JonisJon; 03-02-2009 at 05:10 PM.

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #6
    New Coder
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts
    There ya go, reformatted... sorry about that, I am still having this problem with IE, anyone have any ideas?

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    I think, we had fixed a similar issue at http://www.codingforums.com/showthread.php?t=159791
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #8
    New Coder
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I took of the width settings of the box divs, that seems to have solved the problem. However I have to set the padding of the .box to only 20px (and i would like closer to 60), but otherwise it will be off the page in IE.

  • #9
    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 JonisJon,
    Try this for .box
    Code:
    .box {
    	background-color: #fff;
    	position: relative;
    	width: 95%;
    margin: 0 auto;
    }
    If padding .box is giving you trouble you can always add margin to the content of .box to move it away from the edges.
    Could also center a container div in there with no background color to keep things lined up.
    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

  • #10
    New Coder
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts
    That worked quite nicely, thanks for the fix excavator, it looks a lot better using that margin code than using padding.


  •  

    Posting Permissions

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