div + css格式控制

来源:百度知道 编辑:UC知道 时间:2024/04/29 06:00:26
格式问题,看下面代码
<!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=utf-8" />
<title>无标题文档</title>
<style>
#left{
background-color:blue;
height:32px;
width:left;
float:left;
}
#right{
background-color:yellow;
width:100px;
height:32px;
float:right;

}
</style>
</head>

<body>

<div style="width:100%;">
<div id="left">hhhhhhhhhhhhhhhhhhhhhh

<!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=utf-8" />
<title>无标题文档</title>
<style>
#left{
background-color:blue;
height:32px;
width:expression(parseInt(body.offsetWidth)-100);
float:left;
}
#right{

background-color:yellow;
width:100px;
height:32px;
float:right;

}
</style>
</head>

<body>

<div style="width:100%;">
<div id="lef