This is a discussion on "difficulty with a float left and right layout" within the Web Page Design section. This forum, and the thread "difficulty with a float left and right layout are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
difficulty with a float left and right layout
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
difficulty with a float left and right layout
Bonjourno,
I have this layout in which elements are floated left and right on the page, and im encountering some difficulties. The first is a problem ive experienced before but can't remember a way round it. Firefox isn't displaying the background colour, despite the div containing the elements having a background colour specified...
The next issue is that when I add padding inside the floated left and right content boxes using <p>, the whole page shifts left, despite all the elements being inline. This can be demonstrated by switching between 'home' and 'about' in the nav bar.
Quote:
Matt |
|
|
|
#2
|
|||
|
|||
|
Re: difficulty with a float left and right layout
It's because the float property removes those elements it is applied to from the flow of the document. I think its overflow:auto; that solves it though that could be wrong. Add it to the container div and it should (might) work.
Pete. |
|
#3
|
|||
|
|||
|
Re: difficulty with a float left and right layout
yes, add overflow: hidden;
to the maincontent div. I don't see the padding problem. |
|
#4
|
|||
|
|||
|
Re: difficulty with a float left and right layout
Not auto then.
Woops. Pete. |
|
#5
|
|||
|
|||
|
Re: difficulty with a float left and right layout
In firefox the whole 'about' page shifts to the left when compared with the 'home' page.
that overflow seems to have done the trick, ta. *EDIT problem seems to have sorted itself out. Funny how that happens.... code and div wise, does this look like a 'clean' way of acheiving the look I'm after? Possible to remove the 'profilecontainer' per chance? many thanks Last edited by konnor5092; Aug 9th, 2007 at 21:42. |
|
#6
|
|||
|
|||
|
Re: difficulty with a float left and right layout
I do think you can delete the profilecontainer div. That one did seem extra.
Otherwise, it was logical ...That's how I would do it too. |
|
#7
|
|||
|
|||
|
Re: difficulty with a float left and right layout
IE doesn't seem to like it removed unfortunately.
Still got this shifting problem in FF. Don't spose anyone else has noticed it? |
|
#8
|
|||
|
|||
|
Re: difficulty with a float left and right layout
But IE if fine with the div? Then if that's the case, put it back. I'd need to look again but it's late. I'll give it a go tomorrow.
|
|
#9
|
|||
|
|||
|
Re: difficulty with a float left and right layout
Maybe I can't see the problem but I've refreshed and refreshed and I don't see any problems in shifting in any browser and I don't see anything wrong with the two div's that are floating.
Maybe someone else can test this? |
|
#10
|
|||
|
|||
|
Re: difficulty with a float left and right layout
very strange. If I change the resolution on my monitor, it no longer happens! I'll leave it be. Can't be a code problem.
Thanks for taking the time to have gander. *EDIT - Oh I am a silly sausage! It was because when the content becomes more than a page in height, it adds the scroll bar down the right hand side of the browser, so everything is shifted left and recentred to accomodate. Last edited by konnor5092; Aug 10th, 2007 at 15:57. |
![]() |
| Tags |
| colour, float, ieff |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Difficulty with HTML E-mail... | TheLion | Web Page Design | 3 | Jan 24th, 2008 20:50 |
| Float: Left with firefox | magnetica | Web Page Design | 2 | Aug 24th, 2007 16:55 |
| help useing float building page right to left | rocket468 | Web Page Design | 5 | Jan 23rd, 2007 23:56 |
| Problems with float:left float:right | nvidiajoe | Web Page Design | 8 | Nov 17th, 2006 20:24 |