大家好我有HTML代碼,這樣寬度包裝DIV和內容的權利應取決於內容的內容增加寬度的右
<html>
<head>
<style type="text/css">
body {
font-family:arial,helvetica,sans-serif;
font-size:12px; background-color: blue;
}
**#wrapper {
width:900px;
margin:0px auto;
border:1px solid #bbb;
padding:10px; background-color: pink;
}**
#header
{
border:1px solid #bbb;
height:80px;
padding:10px;
}
#content
{
margin-top:10px;
padding-bottom:10px;
}
#content div
{
padding:10px;
border:1px solid #bbb;
float:left;
}
**#images
{
position:relative;
top:0px;
}**
#content-left
{
width:380px;
}
**#content-right
{
position:relative;
top:0px;
margin-left:10px;
width:534px;
}**
#footer
{
float:left;
margin-top:10px;
margin-bottom:10px;
padding:10px;
border:1px solid #bbb;
width:878px;
}
#bottom
{
clear:both;
text-align:right;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">Header</div>
<div id="content">
<div id="content-left"></div>
**<div id="content-right"><div id="images"><img src="pics02.jpg"
width="300px;height="900px" /></div>**
</div>
</div>
<div id="footer"></div>
<div id="bottom"></div>
</div>
</body>
</html>
我想如果我插入內容的權利一些內容的問題如果內容的寬度超過了內容的寬度,則第一個內容的權利應該擴大,然後包裝器應該擴展,但這不會發生在那裏,並且正在從包裝器中出來。任何人都可以指導我如何着手。
你應該接受答案 –