CSS float problem Advanced

This is a discussion on "CSS float problem Advanced" within the Web Page Design section. This forum, and the thread "CSS float problem Advanced are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 15th, 2007, 11:53
Up'n'Coming Member
Join Date: Aug 2007
Location: Bicester
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
CSS float problem Advanced

Hi

All you CSS gurus. I have a problem with the way my CSS is handled between IE 7 and FF/Safari. This is the code:

Code: Select all
<div >
xx
<span style="float:left" >x</span>
<span style="float:left" >x</span>
</div>
The div has no style on it. In FF/Safari the spans float outside the div which causes major problems. Basically looking at it in Firebug the div is rendered as a single line and the spans (which in fact contain images) float above it - only the xx which has no float on it appears inside the div. In IE 7 the are rendered inside the div which expands to accomodate them.

why does this happen in FF and how could I make it act like IE 7?

with thanks

Justin
Reply With Quote

  #2 (permalink)  
Old Aug 15th, 2007, 12:07
Up'n'Coming Member
Join Date: Aug 2007
Location: Bicester
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS float problem Advanced

Well. i did some research and this seems to be the rule:

In FF or safari if you float an element in a parent which does not have float or position set the children will float outside the parent.

In IE 7 floated child elements stay inside their parent even if that parent has no float or position

In IE 6 it is similar to FF/Safari except setting a width on the parent works as well as setting a float or position.

Does anyone know what the standards are?
Reply With Quote
  #3 (permalink)  
Old Aug 15th, 2007, 12:21
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS float problem Advanced

Quote:
Does anyone know what the standards are?
not sure what your asking here.

And I guess if you just add position relative to the floats then it should work?
Reply With Quote
  #4 (permalink)  
Old Aug 15th, 2007, 12:34
Up'n'Coming Member
Join Date: Aug 2007
Location: Bicester
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS float problem Advanced

Hi 1840dsgn

(do you have a human handle? 1840dsgn sounds so cryptic)

Yeah. I'm not sure what my question was - but it seems that the different browsers interpret floats in elements which are not floated in different ways - which is worrying because your design may look fine in all current browsers - but who knows about future ones?

Oh sorry about my behaviour yesterday. I was being stalked at work and was a bit tense

Justin
Reply With Quote
  #5 (permalink)  
Old Aug 15th, 2007, 13:15
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS float problem Advanced

No problems - I guess a good discussion if what forusm are all about!

Yea I know its just smeothing we have to put up with...but we can assume that the future browsers will be even better at handling CSS - therefore hopefully we shouldn't have too many fixes to think about.

But when it comes to browser release time you have to check your sites to make sure that a hack that maybe you were doing for IE support isn't now runing your site.

but as I said CSS support should only get better in which case - if you have coded your CSS well - it shouldn't be a problem with future releases.

but yea...cross browser support is a pain in the arse at the moment - especially with the less aware people sticking with IE6 and not upgrading.

We need to run a MASSIVE campaign web wide to get everyone to ditch IE6 lol.
Reply With Quote
  #6 (permalink)  
Old Aug 15th, 2007, 13:19
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS float problem Advanced

and yea my name is Mike!
Reply With Quote
  #7 (permalink)  
Old Aug 15th, 2007, 16:08
Up'n'Coming Member
Join Date: Aug 2007
Location: Bicester
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS float problem Advanced

Mike

i see 1840dsgn is the name of your company

I found the tutorial on mod_rewrite helpful

Thanks

Justin
Reply With Quote
  #8 (permalink)  
Old Aug 15th, 2007, 16:21
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS float problem Advanced

Quote:
I found the tutorial on mod_rewrite helpful
Excellent thats good to hear.
Reply With Quote
Reply

Tags
float

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Float problem with Firefox Emzi Web Page Design 10 Apr 4th, 2008 12:02
css float problem milly Starting Out 3 Jul 9th, 2007 02:51
3 CSS Issues, including a float problem in IE6 TheoUK Web Page Design 1 Jul 3rd, 2007 23:56
right float problem... c_martini Web Page Design 11 Aug 2nd, 2006 13:47
Image float problem timmytots Web Page Design 6 Jul 8th, 2006 13:40


All times are GMT. The time now is 16:10.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43