Accessibility

CSS Advisor

DIV Background Color does not display in browser

by Knocknadogue on April 16, 2010 Avg Rating 2.5 (2)   |   Log in to rate post.

Tagged with Explorer 6.0 , Firefox 3.0 , Explorer 8.0 , Explorer 7.0 , Color , Firefox 3.5 , Child changes parent , Background

Problem

DIV Background Color does not display in browser

Solution

DIV Background Color does not display in browser

Detailed description

Hello,

I will appreciate any help or advice. Thanking you in advance!

I’m building website using Dreamweaver CS4.

I’ve created a template with four (4) editable regions,

IE.

1 x main content DIV with transparent background

* 1 x content DIV with white background for behind our text content

2 x sidebars with image background

42 pages built based on this template (.dwt)

 

The PROBLEM(s) as follows:

a). The colour background of content DIV* does not display in browsers IE or Firefox,

IE. So there is no white background displayed behind text as required for visibility of text.

Please advise how to get selected background colour to appear behind text in browser?

b). While working on various CHILD pages, changes made to background colour of DIVs

on CHILD, have ALSO changed the background colour of the DIV in template (Not supposed to happen this way... right?) And in turn change the background colour of all 42 pages built from the template.

Please advise why this is happening and how to prevent its re-occurance?

Thank you!

Best regards,

Riann




Text ID: DIV_BACKGROUND_COLOR_DOES_NOT_DISPLAY_IN_BROWSER



Comments (2)

To add a comment, please Log in.




Clear the floats..

Is it the case that your content in the parent div is all floated (float right/left..)
this usually results in that missing background color problem...
add a <div style="clear:both"></div> at the end of your parent div whose bg is missing.. this will extend the div upto its content..

Place Body Property Below your Container(if you have one)

I've had that problem. I had to add the body  property  below my container property, then it worked!

Weird though.





CSS Advisor home
Submit a post

rss

CSS ADVISOR RSS FEEDS
Recent: POSTS | COMMENTS | EDITS


Browsers
Internet Explorer (103)
Mozilla/Firefox (52)
Opera (18)
Safari (38)
CSS Properties
Background (25)
Border (10)
Color (10)
Float (23)
Font (6)
Margin (11)
Padding (9)
Position (40)
Text (30)
Width/Height (27)