|
From: rcw1983 on 7 May 2008 10:21 I'm trying to get two divs on the same line....the problem I have is when the browser window gets smaller, the second div is being pushed below the first div....I want them to stay on the same line. Here is my code: <div style="white-space:nowrap"> <div style="float:left"> Left Column </div> <div style="float:left;margin-left:10px"> Right Column </div> </div>
From: David Stone on 7 May 2008 10:40 In article <4b6fdb6f-7f5f-4b13-8b77-333315f100c8(a)56g2000hsm.googlegroups.com>, rcw1983 <rwiegel(a)gmail.com> wrote: > I'm trying to get two divs on the same line....the problem I have is > when the browser window gets smaller, the second div is being pushed > below the first div....I want them to stay on the same line. Here is > my code: > > <div style="white-space:nowrap"> > <div style="float:left"> > Left Column > </div> > <div style="float:left;margin-left:10px"> > Right Column > </div> > </div> Set a width of a bit less than 50% on each (to allow for a margin between the two), then float them left and right, respectively? Of course, if your users tend to use large default font sizes with very narrow windows, it will look ugly as all get out!
From: Sherman Pendley on 7 May 2008 11:54 rcw1983 <rwiegel(a)gmail.com> writes: > I'm trying to get two divs on the same line....the problem I have is > when the browser window gets smaller, the second div is being pushed > below the first div. Fluid layout is not a problem, it's a *solution* to the problem that web browser windows can change size. If you're looking for a format where everything is nailed firmly into place, PDF might be more appropriate. sherm-- -- My blog: http://shermspace.blogspot.com Cocoa programming in Perl: http://camelbones.sourceforge.net
From: Andy Dingley on 7 May 2008 12:01 On 7 May, 15:21, rcw1983 <rwie...(a)gmail.com> wrote: > I'm trying to get two divs on the same line....the problem I have is > when the browser window gets smaller, the second div is being pushed > below the first div....I want them to stay on the same line. Then use a <table> If you _really_ want them to stay in their relative position, regardless of whether they still fit into the window, then <table> is the appropriate code to use. You could use position:absolute as well, but that's even more restrictive and problematic.
From: rcw1983 on 7 May 2008 12:15 Thanks for the replies.... Setting the divs to width of 50% won't work because once the content inside the divs gets to be wider than 50% of the browser window the divs again wrap. I am trying to use div's as an alternative to tables for Section 508 compliance Sherman, you were a big help
|
Pages: 1 Prev: Help me confirm a bug in IE 8 b1 Next: Two CSS selector questions |