Solved

Background not repeating in Firefox

Posted on 2006-10-31
3
1,194 Views
Last Modified: 2012-05-05
I'm in the process of converting a 3 column table layout to CSS. I've got it working almost perfectly in IE but in Firefox there's a problem.  The layout involves a 100% width DIV with a banner image.  Under that is 3 DIVs - The left most has an image that should be repeating down the left side of the screen.  The next DIV has the menu and also has a repeating background image.  The right most DIV is the main content DIV.  The problem is the backgrounds for the two left most DIVs do not repeat down to where the content DIV finishes on the screen, they just stop in the middle of nowhere.  Any suggestions, ideas?  Code is below:

file.htm
<!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=iso-8859-1" />
<title>File</title>
<link rel="stylesheet" href="csstest2.css" type="text/css">
</head>
<body>
<div id="background2">
<div id="background1">
   <div id="banner"><img src="images/banner.jpg" alt="Banner"></div>
   <div id="content">....lots of dummy content...</div>
   <div id="lights"><img src="images/lights_background.gif"></div>
   <div id="menu"><img src="images/menuheader.gif" width="150" height="27">
   ...menu content...
   </div>
</div>
</div>
</body>
</html>

csstest2.css
html, body      {
      height: 100%;
}
body {
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 100%;
      color: #3399FF;
      margin: 0;
      padding: 0;
      text-align: justify;
      background-color: #000000;
}
#background1      {
      height: 100%;
      background-image: url(images/menu_background.jpg);
      background-position: 25px 120px;
      background-repeat: repeat-y;
      background-color: transparent;
      }
#background2      {
      height: 100%;
      background-image: url(images/lights_background.gif);
      background-position: 0px 120px;
      background-repeat: repeat-y;
      background-color: transparent;
      }
#banner {
      background-image: url(images/banner_background.jpg);
      background-repeat: repeat;
      background-color: #000000;
      width: 100%;
}
#menu {
      position: absolute;
      width: 150px;
      top: 120px;
      left: 25px;
      margin: 0px 0px 0px 0px;
      padding: 0px;
      background-color: #333333;
      background-image: url(images/menu_background.jpg);
      background-repeat: no-repeat;
      height: 100%;
      }
#menu p      {
      padding: 0px 0px 0px 10px;
      }
#lights      {
      position: absolute;
      width: 25px;
      top: 120px;
      left: 0px;
      padding: 0px 0px 0px 0px;
      background-image: url(images/lights_background.gif);
      background-repeat: repeat;
      height: 100%;
      }
#content {
      margin: 0px 0px 0px 175px;
      padding: 10px 10px 10px 20px;
      height: 100%;
      }
0
Comment
Question by:jpboyce
3 Comments
 
LVL 2

Accepted Solution

by:
SabreCEO earned 250 total points
ID: 17847618
Try this:

add this to #background1
overflow:hidden;

and to banner and lights:
margin-bottom: 10000px;
border-bottom: -10000px;

that should do it, but I'm not sure if the position:absolute will cause you any trouble with it.

-Mark
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Configuring a checkbox in CSS and php 18 94
Problem to refer to value 8 62
Change Firefox bookmarks menu font size 2 34
Make footer stick to bottom 6 18
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question