4个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>宽度自适应布局</title>
<style>
body,div{ margin:0; padding:0;}
div{ height:200px; color:#F00;}
.left{ float:left; width:100px; background:#00f; _margin-right:-3px;}
.right{ float:right; width:100px; background:#0f0; _margin-left:-3px;}
.center{ background:#333; margin:0 100px; _margin:0 97px;}
</style>
</head>
<body>
<div class="left">left</div>
<div class="right">right</div>
<div class="center">center</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<title>宽度自适应布局</title>
<style>
body,div{ margin:0; padding:0;}
div{ height:200px; color:#F00;}
.left{ float:left; width:100px; background:#00f; _margin-right:-3px;}
.right{ float:right; width:100px; background:#0f0; _margin-left:-3px;}
.center{ background:#333; margin:0 100px; _margin:0 97px;}
</style>
</head>
<body>
<div class="left">left</div>
<div class="right">right</div>
<div class="center">center</div>
</body>
</html>
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>宽度自适应布局</title>
</head>
<style>
*,body{
margin:0 auto;
padding:0;
}
.abc{
border:10px #F00 solid;
background-color:#CCF;
height:170px;
width:1000px; /*改宽度试试*/
position:relative;
}
.aa{
width: 150px;
height: 150px;
border: 10px solid #0F0;
background-color: #FC9;
position:absolute;
left:0px;
}
.bb{
width:auto;
border:10px solid #000 ;
height:150px;
background-color:#9F6;
left:170px;
right:170px;
position:absolute;
}
.cc{
width:150px;
border:10px solid #FF0;
background-color:#0CF;
height:150px;
position:absolute;
right:0px;
}
</style>
<body>
<div class="abc">
<div class="aa"></div>
<div class="bb"></div>
<div class="cc"></div>
</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<title>宽度自适应布局</title>
</head>
<style>
*,body{
margin:0 auto;
padding:0;
}
.abc{
border:10px #F00 solid;
background-color:#CCF;
height:170px;
width:1000px; /*改宽度试试*/
position:relative;
}
.aa{
width: 150px;
height: 150px;
border: 10px solid #0F0;
background-color: #FC9;
position:absolute;
left:0px;
}
.bb{
width:auto;
border:10px solid #000 ;
height:150px;
background-color:#9F6;
left:170px;
right:170px;
position:absolute;
}
.cc{
width:150px;
border:10px solid #FF0;
background-color:#0CF;
height:150px;
position:absolute;
right:0px;
}
</style>
<body>
<div class="abc">
<div class="aa"></div>
<div class="bb"></div>
<div class="cc"></div>
</div>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<!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=gb2312" />
<title></title>
</head>
<body>
<div style="width:100px; height:500px; float:left; background-color:#0F0;"></div>
<div style="width:auto; height:500px; background-color:#00F; float:left; color:#FFF;">这里的内容决定宽度</div>
<div style="width:100px; height:500px; float:left; background-color:#639;"></div>
</body></html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<body>
<div style="width:200px; height:500px; border:1px solid red; float:left;">1</div>
<div style="width:auto; height:500px; border:1px solid green; float:left;">222222222222222222222222</div>
<div style="width:200px; height:500px; border:1px solid blue; float:left;">3<div>
</body>
<div style="width:200px; height:500px; border:1px solid red; float:left;">1</div>
<div style="width:auto; height:500px; border:1px solid green; float:left;">222222222222222222222222</div>
<div style="width:200px; height:500px; border:1px solid blue; float:left;">3<div>
</body>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询