Solved

Background not repeating in Firefox

Posted on 2006-10-31
3
1,188 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
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 define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now