gpt4 book ai didi

html - 带有文本和图像的水平菜单

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

这是我的菜单的 css 和 html。我正在尝试弄清楚如何使它全部水平。任何帮助将不胜感激。干杯。

ol {
margin-top: 20px;

}

#images {
margin-left: 10px;
}

#images-text {
background: #f5f8ef;
border-radius: 10px;
width: 300px;
height: 40px;
font-family: Impact, Charcoal, sans-serif;
display: inline;

}

这是html

  <ol>
<li class="newbar">
<div id = "images">
<img src="images/crowd.png" width ="200" height="180">
<img src="images/crowd.png" width ="200" height="180">
<p>

<div id = "images-text">
Arctic Monkeys
</div>
<div id = "images-text">
Arctic Monkeys
</div>
</div>
</li>
</ol>
</div>

最佳答案

您不需要使用 <ol> .如果你有 <img>对于下方或上方的一些文本,最好使用 <figure><figcaption>用于图像文本。

<figure>
<figcaption>
Image text
</figcaption>
<img src="images/crowd.png">
</figure>

如果你想要<img>下方的图片文字只需将 <figcaption><img> 下面.

然后,<div> 中的数字 :

<div>
<figure>
...
</figure>
<figure>
...
</figure>
<figure>
...
</figure>
...
</div>

每个 <figure>CSS :

div figure {
display: inline-block;
}

CSS 选择器 用法:http://www.w3schools.com/css/css_selectors.asp

示例:http://jsfiddle.net/qpk9smm8/

关于html - 带有文本和图像的水平菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27065287/

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