i have this simple layout css which provide 3 rows layout
css code
<style type="text/css">
body {
width:750px;
margin:0 auto;
margin-top:30px;
}
/* ----- HEADER ----- */
#header {
width:750px;
height:150px;
background-color:#333333;
}
/* ----- MAIN CONTENT ----- */
#content {
width:750px;
background-color:#333333;
margin-top:10px;
min-height:500px; /* for modern browsers */
height:auto !important; /* for modern browsers */
height:500px; /* for IE5.x and IE6 */
}
/* ----- FOOTER ----- */
#footer {
width:750px;
height:100px;
background-color:#333333;
margin-top:10px;
}
</style>
and here is the 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>example page</title>
</head>
<body>
<div id="header">
</div>
<div id="content">
</div>
<div id="footer">
</div>
</body>
</html>
what i need to do that every div created with in the header div must have float to left format
<div id="header"><div>welcome</div></div>
this for example this div have welcome must have float left format without passing any class or id
To answer your question directly, you can do:
But why? Can you not use span instead of div? If you don’t need id or class tags, why any tags at all?