父元素使用了position: absolute;怎么让子元素并排显示? 30
<styletype="text/css">#a{position:absolute;border:1pxsolidblack;}#b{border:1pxsolidre...
<style type="text/css">
#a{
position: absolute;
border: 1px solid black;
}
#b{
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
#c{
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
</style>
<div id="a">
<div id="b">
</div>
<div id="c">
</div>
</div>
比如这个 怎么让B和C并排包含在A里
<style type="text/css">
#aa {
position: relative;
border: 1px solid black;
width: 80px
}
#a {
position: absolute;
border: 1px solid black;
left: 100%;
}
#b {
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
#c {
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
li{
min-width: 30px;
list-style: none;
}
</style>
<div id="aa">
<ul>
<li>1</li>
<li>
<div id="a">
<div id="b">
</div>
<div id="c">
</div>
</div>
</li>
<li>2</li>
</ul>
</div>
这是 a的position: absolute;状态
这是a的position: relative;状态
我不能让1和2被撑开。 展开
#a{
position: absolute;
border: 1px solid black;
}
#b{
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
#c{
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
</style>
<div id="a">
<div id="b">
</div>
<div id="c">
</div>
</div>
比如这个 怎么让B和C并排包含在A里
<style type="text/css">
#aa {
position: relative;
border: 1px solid black;
width: 80px
}
#a {
position: absolute;
border: 1px solid black;
left: 100%;
}
#b {
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
#c {
border: 1px solid red;
width: 94px;
height: 94px;
margin: 2px;
}
li{
min-width: 30px;
list-style: none;
}
</style>
<div id="aa">
<ul>
<li>1</li>
<li>
<div id="a">
<div id="b">
</div>
<div id="c">
</div>
</div>
</li>
<li>2</li>
</ul>
</div>
这是 a的position: absolute;状态
这是a的position: relative;状态
我不能让1和2被撑开。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询