Patrick Aljord wrote:
> I have two divs <div id=regions> blabla</div><div id=categories>
> blabla</div>.
> The problem is that when regions gets too much content, the categories div
> breaks line and is display below the region div. How can I force them to
> always be align even if that requieres to horizontally scroll the screen?
> here is the css code:
> #regions{
> float:left;
> margin-right: 0px;
> font-size : 15px;
> color:black;
> }
> #categories{
> border: 4px solid;
> background-color: white;
> width: 75%;
> float:right;
> font-family: verdana, arial, helvetica, sans-serif;
> font-size: 15px;
> }
>
> Thanx in advance
>
> Pat
Both floats need a width. The right float should come first in the
source order. Clear both floats. I put the the floats in a specified
with container to make it a little easier to see.
CSS
html, body { background-color: #fff; color: #000; }
body { font: normal 100%/normal arial, sans-serif; text-align:center; }
p{ margin: 6px; padding: 0;}
div#container { border: 1px solid fuchsia; margin: 0 auto; text-align:
left; width: 750px; }
div#categories { border: 4px solid gray; float: right; width: 74%; }
div#regions { float:left; width:24%; }
br.both { clear: both; }
HTML
<div id="container">
<div id="categories">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed .</p>
</div>
<div id="regions">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed .</p>
</div>
<br class="both" />
</div>
Sometimes I put an xml declaration <?xml version="1.0"
encoding="utf-8"?> above the doctype to make it easier to cope with the
various versions of Win/IE (but that's your call, not mine).
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st
November 2002), see www.w3.org" />
<title>whatever your title is</title>.
Best,
~dL
--
http://chelseacreekstudio.com/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/