1
我有这个至今:![在这里输入的形象描述] [1] [1]这里div元素的垂直位置
https://iamsteve.me/uploads/blog/inline-block-example.png
问题是,我不知道如何改变这个div元素的垂直位置。我被允许为旧浏览器使用CSS1和CSS2。
HTML
<div id="graph">
<div style="height: 100px;" class="row"></div>
<div style="height: 200px;" class="row"></div>
<div style="height: 100px;" class="row"></div>
<div style="height: 250px;" class="row"></div>
<div style="height: 300px;" class="row"></div>
<div id="legend">
<div class="text">10</div>
<div class="text">20</div>
<div class="text">30</div>
<div class="text">40</div>
<div class="text">50</div>
</div>
</div>
CSS
.text {
background-color: gray;
width: 18%;
float: left;
margin: 1%;
text-align: center;
}
.row {
background-color: gray;
width: 18%;
float: left;
margin: 1%;
}
我更新了我的回答,其背后的原因是为什么我不使用float,希望它有用。 – Zze