CSS question

Associate
Joined
25 Jul 2005
Posts
430
Hi, I'm trying to make a div with a 2 colour background (top half one colour bottom half another). I know I could do it with a small gif and tile it horizontally, but if the user then changes the text size, it will go **** up as the image will be a fixed height. Is there a better way of doing this purely with css so it can scale up?
Cheers.
 
psyr33n said:

Edit:

index.html
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Split Divs</title>
	<link rel="stylesheet" type="text/css" href="style.css" media="all" />
</head>
<body>
	<div id="cont">
		<div id="top">
			Top Div
		</div>
		<div id="bottom">
			Bottom Div
		</div>
	</div>
</body>
</html>

style.css
Code:
*,html{margin:0;padding:0}
#cont{width:780px;height:400px;margin:0 auto}
#top{height:50%;background:#ff0}
#bottom{height:50%;background:#f00}
 
Last edited:
Back
Top Bottom