gpt4 book ai didi

html - float div 宽度

转载 作者:太空宇宙 更新时间:2023-11-04 13:00:41 25 4
gpt4 key购买 nike

我正在尝试设置 float div 的宽度(或最大宽度)值。我尝试了各种选择,但没有一个对我有帮助。

这是我的HTML

<div class="tab-content">
<div id = "basicInfo" class = "tab active">
<h1>Results</h1>
<span style="clear: both;"></span>

<p>Browser version: internet explorer 8</p>
<h2>Plan details:</h2>
<ul>
<li>Plan description: not set</li>
</ul>
</div>

<div id = "statInfo" class = "tab">
<div id="chartcontainer"><p>Pie chart placeholder</p></div>
<h1>Statistics</h1>
<p>text</p>
<p>text</p>
<p>text</p>
</div>
</div>

这是我的 CSS

.tab-content {
position: relative;
border-top-left-radius: 0;
padding: 10px 10px;
margin-bottom:20px;
background:#FEFEFE;
min-width: 1165px;
max-width: 1200px;
overflow: hidden;
}
#basicInfo {
border-style: none;
}
#statInfo {
border-style: none;
}
#chartcontainer {
width: 200px;
height: 200px;
max-width: 200px;
max-height:200px;
margin: 20px 20px;
float:right;
}
.clr {
clear:both;
}

chartcointainer 的 Div 应该向右浮动,紧挨着三个“文本”段落。高度变化正确,但宽度有问题。 chartcontainer 始终占用从段落末尾到父 div 边缘的整个“空白”。

谢谢

最佳答案

试试这个

right:0; 
position:absolute;

关于html - float div 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25485883/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com