WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > Browser Compatibility > Background height problem in FireFox but work in IE

Reply
  Thread Tools Display Modes
Old 15th March 07, 10:54 PM   #1
EthanCote
WLC Member
 
Join Date: Mar 2007
Posts: 5
Default Background height problem in FireFox but work in IE

Hello,

If this problem has already been addressed, please point me to the correct post(s) for solutions. Thanks.

I am trying to create my site using css and I ran into the problem with background not appearing in Firefox (FF) if height tag is not set but seems to show up fine in IE regardless of height tag set or not.

I am using this css to frame my other divs:

#project_management_frame {
background-image: url(images/interface/bg.gif) !important;
background-repeat: repeat;
background-color: #ffffff;
width: 960px;
height: 100%;
margin: 0px;
padding: 0px;
}

You will notice that I had to set the height property in order for the background to show up in Firefox ("height: 100%;"), however in IE, whether I set the height property or not, the background still appear and appear correctly without adding additional vertical spacing.

The problem with setting the height to 100% is that the height stretches vertically by giving me alot of vertical spaces in FF. And if I remove the height tag, the background image will not show up at all. I can not set the height to pixel size since the height will vary from pages to pages (since I will be using the same layout) and this will mean I will need to create different div for different pages and I do not wish to do that.

You can view this problem here:
http://www.vertabase.com/test/css_help.html

Link to my css:
http://www.vertabase.com/test/projec...t_software.css

How do you solve this problem? It is driving me mad. I have try to research this problem online but came up empty handed and I hope the users here can help me.

Thank you for your help.

Cheers,

Chi.
EthanCote is offline   Reply With Quote
Old 16th March 07, 02:59 AM   #2
zak
WLC Member
 
zak's Avatar
 
Join Date: Mar 2007
Location: Troy, NY
Posts: 24
Default Re: Background height problem in FireFox but work in IE

From a quick glance at your CSS, it seems the problem is that since all the contents of #project_management_frame are floated (which takes them out of the normal flow of elements), #p_m_f doesnt know their heights, and doesnt extend down to contain them.

Luckily, you have an <img> at the bottom, which you can use to clear the contents and have the #p_m_f extend down dynamically.

So, in a nutshell, do this:

Code:
<IMG SRC="images/interface/border_bot.gif" WIDTH="960" HEIGHT="36" BORDER="0" style="display:block; clear:both;">
And see if that fixes it.

An extensive article on this clear fix can be found at http://www.positioniseverything.net/easyclearing.html
zak is offline   Reply With Quote
Old 16th March 07, 04:09 AM   #3
EthanCote
WLC Member
 
Join Date: Mar 2007
Posts: 5
Default Re: Background height problem in FireFox but work in IE

Thanks alot ZAK!!!!

You rock bud!!!

I deleted the height: 100%; and I moved the:

<IMG SRC="images/interface/border_bot.gif" WIDTH="960" HEIGHT="36" BORDER="0" style="display:block; clear:both;">

within the <DIV ID="project_management_frame"> tag and it worked perfectly!!!

This had me so stomped. I was pulling my hair out. lol

Thanks again!


Cheers,

Chi.
EthanCote is offline   Reply With Quote
Old 16th March 07, 06:34 AM   #4
zak
WLC Member
 
zak's Avatar
 
Join Date: Mar 2007
Location: Troy, NY
Posts: 24
Default Re: Background height problem in FireFox but work in IE

anytime, glad it worked out
zak is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not Ie or firefox problem..? Div problem I think Bouzy Browser Compatibility 1 19th July 07 07:16 PM
background image not appearing. mattrd CSS 4 2nd February 07 01:32 PM
DIV background causing problem in FireFox thePezIsMine Browser Compatibility 0 29th December 06 04:05 AM
List problem... willsmith727 CSS 1 1st September 06 01:54 PM
Background-image problem alvinchipmunk CSS 7 15th August 06 10:32 PM


All times are GMT. The time now is 05:07 PM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyright© 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.