Click to See Complete Forum and Search --> : Using a wildcard width in CSS?
Drakim
08-12-2009, 09:20 AM
Check this link first:
http://www.netmechanic.com/news/vol3/html_no3_table_eg1.htm
Here, there are two colons, and one of them is a fixed size, while the other takes whatever is left over. My question is, is this possible to do with CSS and DIVs, rather than designing the website with tables?
coothead
08-12-2009, 10:28 AM
Hi there Drakim,
here is an example...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>Example</title>
<style type="text/css">
#container {
height:1%;
border:1px solid #999;
padding:3px;
font-family:arial,helvetica,sans-serif;
font-size:70%;
overflow:hidden;
}
#container:after {
content:'';
display:block;
clear:both;
}
#fixed_width {
width:96px;
padding:2px;
border:1px solid #000;
float:left;
background-color:#f00;
}
#unfixed_width {
padding:2px;
margin-left:105px;
border:1px solid #000;
background-color:#090;
}
</style>
</head>
<body>
<div id="container">
<div id="fixed_width">col 1, 100 pixels </div>
<div id="unfixed_width">col 2, wild card </div>
</div>
</body>
</html>
coothead