This is a discussion on "Odd float/menu combination" within the Web Page Design section. This forum, and the thread "Odd float/menu combination are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Odd float/menu combination
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Odd float/menu combination
Hi guys,
I'm trying to get some very specific float behaviour and I'm not sure if it can be done or not, or if it's blatantly obvious. Basically, at the top of the page I want a small image (logo) floated to the right, and a horizontal menu (although for these purposes, just, say, some text) on the left. The menu/text is short enough that, in a normal browser window, it has no need to wrap. However, I'm a stickler, so what I want to happen if the window is narrowed is this: first the text jumps down a line (because it doesn't fit next to the image); then when (and only when) the browser window itself gets too narrow for the text, the text starts wrapping. I've tried just floating the image to the right, and the text wraps as soon as it gets too wide for [broswer window width - image width]. I've tried fixing the text width, but then it doesn't wrap at all. It's like I'm looking for a "soft" break condition (when the image is trying to squash the text) and a "hard" break condition (when it's the window itself doing the squashing) and I'm not sure such a thing exists. Unless it's something obvious! So yeah, thanks if anyone can help me, and sorry if this is a dumb question! |
|
|
|
|||
|
Re: Odd float/menu combination
I might be wrong, but I don't think it can't be done with CSS alone. The problem is that you would need to specify the width of the menu/text element depending on where it is displayed.
I can think of a way to do this with JavaScript, but that is probably not what you want. |
|
|||
|
Re: Odd float/menu combination
Yeah, thanks for the offer, but I'm trying to keep things simple.
|
![]() |
| Tags |
| css float menu |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Css Float??? | RZX Developer | Web Page Design | 4 | Aug 13th, 2007 10:37 |
| CSS Float Issue | Ryan Fait | Web Page Design | 5 | Jan 16th, 2007 14:59 |
| Problems with float:left float:right | nvidiajoe | Web Page Design | 8 | Nov 17th, 2006 20:24 |
| float question... | asa_carter | Web Page Design | 4 | Aug 27th, 2006 00:18 |
| IE6 Float | masonbarge | Web Page Design | 8 | Aug 16th, 2006 10:13 |