Web Analytics Made Easy -
StatCounter CSS not allowing div to expand? - CodingForum

Announcement

Collapse
No announcement yet.

CSS not allowing div to expand?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CSS not allowing div to expand?

    Hey,
    I've been working on my site and for some reason I can't get my content image to expand with the content.

    To view the site, click here.

    Here's my stylesheet:

    Code:
    body {
    	background-image: url('images/background.jpg');
    	margin: 0;
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 7.5pt;
    }
    
    #container {
    	margin-left: auto;
    	margin-right: auto;
    	height: 100%;
    }
    
    #header {
    	height: 106px;
    	background-color: #ABE7EE;
    	border-bottom: solid #C2C2C2 10px;
    }
    
    #navUp {
    	height: 106px;
    }
    
    #navOver {
    	height: 106px;
    	visibility: hidden;
    }
    
    #content {
    	width:1024px;
    	background-image: url('images/content.gif');
    	height: 100%;
    	min-height: 655px;
    }
    
    #wrap {
    	background: transparent;
    	width: 812px;
    	height: 100%;
    	padding-top: 10px;
    }
    
    #main {
    	float: left;
    	width: 555px;
    	height: 100%;
    	text-align: center;
    	padding-left: 5px;
    	padding-right: 8px;
    }
    
    #right {
    	position: relative;
    	margin-left: 580px;
    	width: 240px;
    	height: 100%;
    	text-align: center;
    }
    
    #welcome {
    	width: 400px;
    	border-top: 5px solid #696060;
    	background-color: #A49A9A;
    	margin-left: auto;
    	margin-right: auto;
    	padding-left: 10px;
    	padding-right: 10px;
    	padding-top: 3px;
    	padding-bottom: 5px;
    }
    Thanks!

  • #2
    try changing your content attributes to the following

    Code:
    #content {
    	width:1024px;
    	[COLOR="Red"]background-image: url('images/content.gif') repeat-y;[/COLOR]
    	min-height: 655px;
    }
    Cause it looks good in Google Chrome and IE7 but in FF it looks messed up so hopefully this will fix it.
    Eric "PitbullMean" Melo
    Always Start your layout with*{border:0; margin:0; padding:0;}
    Be sure to Thank ALL Users who give assistance.

    Comment


    • #3
      Hello EricaL,
      Try this bit in red -
      Code:
      #content {
      	width:1024px;
      	background-image: url('images/content.gif');
      	height: 100%;
      	min-height: 655px;
      [COLOR="Red"]overflow: auto;[/COLOR]
      }
      Read about using overflow:auto; to clear floats here - http://www.quirksmode.org/css/clearing.html


      ...
      Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
      Use a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

      Comment


      • #4
        I tried what you suggested and in Firefox, the image doesn't show up at all for some reason.

        I also tried setting:
        background-repeat: repeat-y;
        but that didn't work either.

        EDIT: Thanks Excavator! It worked perfectly.

        Comment


        • #5
          I just noticed what size your background image is. Pitbull is partially right. It will need repeated on the y axis but his method may not work in most browsers.
          Make your CSS for #content look like this instead -
          Code:
          #content {
          	width:1024px;
          	background: url('images/content.gif') repeat-y;
          	height: 100%;
          	min-height: 655px;
          overflow: auto;
          }
          Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
          Use a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

          Comment


          • #6
            Excavator's solution is the correct one because elements are never to expand to contain floated elements. This is an IE bug. His solution makes more modern browsers imitate IEs bug.
            Is IE9 a modern browser?
            IE9 is at least 2 years behind the modern web.

            Comment

            Working...
            X