我正在尝试并排(水平)排列我的列表项。但是,我只能使用 html(不能使用 css)。
此外,我正在尝试让 li 元素移动到图像下方(到页面底部)。
我尝试了各种不同的属性并进行了大量搜索,但似乎没有任何效果。
<div style="background-color:black; margin-top:0px">
<a href="http://csc2.madonna.edu/~brabahy/hw5/mercury2.html"><img src="http://csc2.madonna.edu/~brabahy/hw5/images/Mercury1.jpg" style="float:left; margin-right:10px" height="400" width="400"></a>
<p style="color:brown">Mercury is the smallest planet, and it's closest to the Sun of the eight planets in the Solar System. It has an orbital period of about 88 Earth days.</p>
</div>
<br><br><br><br>
<div>
<ul style="list-style:none">
<li style="text-align:left"><a href="http://csc2.madonna.edu/~brabahy/hw5/museum.html"><p style="color:blue">Previous room</p></a>
<li style="text-align:right"><a href="http://csc2.madonna.edu/~brabahy/hw5/venus1.html"><p style="color:blue">Next room</p></a>
</ul>
</div>
最佳答案
为 li 元素使用此样式属性:
style="text-align:left;float:left;display:inline-block;"
你需要添加:
float:left 和 display:inline-block
关于html - 让 <li> 元素并排在页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30957108/