473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

black background missing in firefox 3 and opera

41
hi all

i have two column div structure in which i have applied black background colour to the main div which holds the two columns (left and right divs).

In internet explorer 7 the structure shows black colour in right side fine but its missing in Firefox 3 and opera 9. why.

please copy and paste the code in your editor and check. the html file is also attached.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. <style type="text/css">
  7. #main{
  8. width:946px;
  9. margin:0px auto;
  10. background-color:#000000; 
  11. height:100%; 
  12. }
  13. #left{
  14. width:201px;
  15. float:left;
  16. height:100%;
  17. background-color:#FFFF00;
  18. }
  19. #right{
  20. background-color:#FF00FF;
  21. width:725px;
  22. padding:10px;
  23. }
  24. </style>
  25. </head>
  26.  
  27. <body style="background-color:#FF0000">
  28. <!-- main starts -->
  29. <div id="main">
  30.  
  31. <!-- left starts -->
  32. <div id="left">
  33. <p style="padding-left:30px; line-height:22px; margin:0px;">
  34. <a href="one.html">Nokia</a> <br />
  35.  Samsung <br />
  36.  HTC <br />
  37.  LG <br />
  38. Sony Ericsson<br />
  39.  Samsung <br />
  40.  HTC <br />
  41.  LG <br />
  42.  Sony Ericsson<br />
  43.  Samsung <br />
  44.  HTC <br />
  45.  LG <br />
  46.  Samsung <br />
  47.  HTC <br />
  48.  LG <br />
  49.  Sony Ericsson</p>
  50. </div>
  51. <!-- left ends -->
  52.  
  53. <!-- right starts -->
  54. <div id="right" style="float:right">
  55. <p>hello how are you</p>
  56. <p>hello how are you</p>
  57. <p>hello how are you</p>
  58. <p>hello how are you</p>
  59. </div>
  60. <!-- right ends -->
  61.  
  62. </div>
  63. <!-- main ends -->
  64. </body>
  65. </html>
  66.  
  67.  
vineet
Attached Files
File Type: zip bg.zip (755 Bytes, 66 views)
Jul 26 '09 #1
2 2793
drhowarddrfine
7,435 Expert 4TB
Never, ever use IE as a reference for how anything should work. It's 11 years behind all other browsers in modern standards and practices and the worst browser on the planet. Note that the more modern browsers, Firefox and Opera (Safari, too), all work the same.

The problem, as it ALWAYS will be, is IE. Parent elements are NEVER to expand to contain floated elements. This is one of the hundreds of bugs and missing properties you are seeing in IE.

To force the modern browsers to act like IEs bug, add 'overflow:auto' to #main.
Jul 26 '09 #2
vinpkl
41
hi drhowarddrfine

thanks for the reply.

overflow:auto worked great. its solved now.

vineet
Jul 27 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Al Dykes | last post by:
I'm playing around with FireFox and RSS for the first time and I'm getting this error "This XML file does not appear to have any style information associated with it. The document tree is shown...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
5
by: Thierry Schembri | last post by:
Hi ! I'm facing problems with a background image in a table (with IE & Opera), it works with FF : the <tr> has a background image, but the background repeats in each <td> ex : tr...
11
by: Konrad Den Ende | last post by:
I have a function returning a string but the problem is that the color of it is blue which suits me well for some pages but not for others. Is it possible to "feel" what the color of the background...
10
by: typingcat | last post by:
Hello. I set a background image like the following; body { background: url('back.png') repeat-x bottom; } See this page for example: http://cat3.dotnet29.hostbasket.com/korean/ When the...
13
by: Giggle Girl | last post by:
Hi there, I need to use a background image in a TR that does NOT restart everytime it hits a TD. Can it be done? Specifically, if you set a background image for an entier table, now mater how...
9
by: hrschp | last post by:
Hi, as far as I know this always worked for a simple webpage up till a few days ago BODY { background-color: white; background-image: url(img/footer.gif); background-repeat: no-repeat;...
2
by: Pugi! | last post by:
I would like to obtain the the position of backgroundimage of a div because I use it for animation. The following code works for Internet Explorer (takes the else if) and returns positionx '10px'...
1
by: HopfZ | last post by:
Is it possible to open an external page in background? window.open('http://www.google.com/search?q='+Math.random()); window.focus(); I tried the above code in three browsers: Firefox 2 -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.