html - 让 <li> 元素并排在页面底部

标签 html css

我正在尝试并排(水平)排列我的列表项。但是,我只能使用 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/

相关文章:

javascript - 如果这段 JS 代码都在同一行,为什么它不起作用?

html - 很难解决和奇怪的 CSS3 不透明过渡问题(...一定是个错误?)

javascript - jquery 星级评定在 bootstrap 弹出窗口中不起作用

css - ReactJS CSS backgroundImage 在滚动调整窗口大小时在底部创建空白

html - 使用图像作为输入文本

javascript - 使用 CSS 或 Java 显示或隐藏空白内容区域

javascript - 如何将新页面加载到我当前的 jQuery colorbox 中?

html - 旋转 div 并创建类似的布局

html - 不显示事件类的右边框

css - TRAC - 更改 css 但在页面加载时被覆盖