WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum > Accessibility and Usability Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Accessibility and Usability Forum Discuss topics related to website accessibility and usability. Subjects include; testing techniques, tutorials, guidelines and legal issues.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2007, 06:28 AM
ozchris ozchris is offline
WebProWorld Pro
 

Join Date: May 2004
Location: Sydney
Posts: 146
ozchris RepRank 0
Default firefox css problem

I usually copy old templates, but thought i would code a clean page from scratch.

I'm a search engine nut, so wanted to have the content before the navigation.

So I thought the standard approach was to put it all in a wrapper, have a top header, then the main section, with the menu floated left and content floated right, and then a footer.

It looked ok in my old Crazybrowser, ok in IE, but Firefox is completely stuffing it up.

Problem 1 is that my content extends down below the wrapper. Why is this? The code is clearly inside the wrapper.

Problem 2 is the footer covers over the stuff above it.

I thought this was a pretty basic page. I'm running Firefox 2.0.0.5.

Any ideas?

The test page is at Untitled Document
Reply With Quote
  #2 (permalink)  
Old 07-24-2007, 08:54 AM
caravan's Avatar
caravan caravan is offline
WebProWorld Member
 

Join Date: May 2006
Location: Preston, Lancashire, UK
Posts: 55
caravan RepRank 0
Default Re: firefox css problem

Hi OzChris,

Your problem sounds similar to one I had a while back. When I had a wrapper which contained several floated divs then the outer collapsed. Several suggestion were put forward but the following link should take you to the one I use.

CSS Float Problem

This comes from a Position Is Everything article

Hope this helps
Reply With Quote
  #3 (permalink)  
Old 07-24-2007, 08:59 AM
sands's Avatar
sands sands is offline
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
sands RepRank 1
Default Re: firefox css problem

Specify the height for div#main. Say 160px for your example.
__________________
My Nook | My Biz
Reply With Quote
  #4 (permalink)  
Old 07-24-2007, 04:46 PM
madmanlear madmanlear is offline
WebProWorld New Member
 

Join Date: Oct 2005
Location: Atlanta, GA
Posts: 9
madmanlear RepRank 0
Default Re: firefox css problem

According to the CSS spec, floated containers don't actually take up space, so they have to be cleared after they end. The simplest way to do this is add "clear:both" to your footer's CSS. I just tried it and it worked great.
__________________
Chris Davis
richandclever.com
Reply With Quote
  #5 (permalink)  
Old 07-24-2007, 04:51 PM
bj's Avatar
bj bj is offline
WebProWorld 1,000+ Club
 

Join Date: Apr 2005
Location: Delaware Valley, PA
Posts: 1,181
bj RepRank 2bj RepRank 2
Default Re: firefox css problem

An approach that might save you a LOT of time in future.

Layout Gala: a collection of 40 CSS layouts based on the same markup and ready for download!

All of the layouts on that page are source ordered and work cross browser, and it pretty much represents most any layout you could possibly want, and with the added bonus of being able to update the layout via the css without changing the html down the road!

The only thing I change is adding a main wrapper to make doing faux columns background treatment and centering easier, and I change doctype to xhtml strict.

Now, to the specifics of your problem. Don't use the height attribute, since it won't allow text resizing, and it's a fake fix. Put this in your stylesheet:

Code:
.clearA {

	overflow: hidden;

	clear:both;

	height:0;

	margin:0;

	font-size: 1px;

	line-height: 0;

        width: auto

        position: relative

}
Now, put this right before the end of the div #main:

Code:
<br class="clearA" />
And that should do it. It's a clearing problem. More info here:

Containing Floats (Complex Spiral Consulting)

And here:

Clearing elements
Reply With Quote
  #6 (permalink)  
Old 07-24-2007, 05:05 PM
bj's Avatar
bj bj is offline
WebProWorld 1,000+ Club
 

Join Date: Apr 2005
Location: Delaware Valley, PA
Posts: 1,181
bj RepRank 2bj RepRank 2
Default Re: firefox css problem

Quote:
According to the CSS spec, floated containers don't actually take up space, so they have to be cleared after they end. The simplest way to do this is add "clear:both" to your footer's CSS. I just tried it and it worked great.
Though your solution works in this particular case you would have a problem with it if you were doing a repeat-y background or a different background color on the #main div, since you'd find out that the div still wasn't being cleared. The background would only go partway down. The solution I suggested works in all cases.
Reply With Quote
  #7 (permalink)  
Old 07-24-2007, 09:49 PM
sands's Avatar
sands sands is offline
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
sands RepRank 1
Default Re: firefox css problem

Quote:
Originally Posted by bj
And that should do it. It's a clearing problem.
Thanks for this fix. This seems to be the only good fix for this particular problem.
__________________
My Nook | My Biz
Reply With Quote
  #8 (permalink)  
Old 07-25-2007, 03:14 AM
ozchris ozchris is offline
WebProWorld Pro
 

Join Date: May 2004
Location: Sydney
Posts: 146
ozchris RepRank 0
Default Re: firefox css problem

You guys are beautiful!

Thanks

(I chose bj's solution of a break to clear the float.)
Haven't uploaded it, but I'll use it on my new site.

A fantastic link to layout gala.
Cheers
Reply With Quote
  #9 (permalink)  
Old 07-25-2007, 03:55 AM
cardinal252 cardinal252 is offline
WebProWorld New Member
 

Join Date: Jun 2007
Posts: 4
cardinal252 RepRank 0
Default Re: firefox css problem

further to the 'height:' usage on the div, firefox and IE 7 both support the use of 'min-height' which has a really similar effect to the 'height' attribute in IE 6, and allows for text resizing.

I have a tendancy to use height in IE 6 conditional commented stylesheet, and use min-height in the main stylesheets.
Reply With Quote
  #10 (permalink)  
Old 07-25-2007, 09:53 AM
bj's Avatar
bj bj is offline
WebProWorld 1,000+ Club
 

Join Date: Apr 2005
Location: Delaware Valley, PA
Posts: 1,181
bj RepRank 2bj RepRank 2
Default Re: firefox css problem

You're welcome!

Yeah, I love layout gala! Saves me a LOT of work figuring things out.
Reply With Quote
  #11 (permalink)  
Old 07-25-2007, 09:59 AM
gwoodstrom gwoodstrom is offline
WebProWorld New Member
 

Join Date: Aug 2005
Location: Houston, TX
Posts: 12
gwoodstrom RepRank 0
Default Re: firefox css problem

Thanks for the link to Layout Gala bj, that will be really useful!
__________________
Gillian Woodstrom
http://www.woodborne.com
Reply With Quote
  #12 (permalink)  
Old 08-18-2007, 06:41 AM
alextj alextj is offline
WebProWorld Member
 

Join Date: Mar 2005
Location: Milano, Italy via Northern Ireland
Posts: 74
alextj RepRank 0
Default Re: firefox css problem

Hi guys,
Ok so I'm a little late to this discussion after my hols.
Although there's a good fix above I'd prefer to sort out the source of the problem, which is this:
div#content {float:right;
Yes the nav needs to be floated left to take it out of the 'flow', but without any float spec the content will automatically snap into the right place with no clearing probs.
Only extra that needs to be added is:
margin:0 0 0 30%(or nav width); to stop it overflowing the nav, and it's also a good idea to add e.g.
min-height:250px;
_height:250px
to the content div in case some content is shorter than the nav which will make the footer behave.
More details here (I have no connection)
2 Column CSS Layout - TheVanBlog
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum > Accessibility and Usability Forum
Tags: css, firefox, problem



Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox hover problem ozchris Web Programming Discussion Forum 4 01-29-2006 08:44 AM
Css display problem in Firefox Spectur Graphics & Design Discussion Forum 3 11-22-2005 10:13 AM
RSS feed problem in Firefox? Phiber IT Discussion Forum 0 08-29-2005 06:32 PM
FireFox Problem jacobwissler Graphics & Design Discussion Forum 2 05-25-2005 04:40 PM
Firefox Problem? splinter Breakroom (General: Any Topic) 12 07-18-2004 08:13 PM


Search Engine Friendly URLs by vBSEO 3.0.0