gpt4 book ai didi

html - 如何在中间对齐文本和图像

转载 作者:太空宇宙 更新时间:2023-11-03 17:29:08 27 4
gpt4 key购买 nike

我在我的网站顶部添加了一个栏,我想将图像和文本对齐到中间。

我该怎么做?到目前为止,这是我尝试过的,似乎我做错了什么。最好的正确方法是什么?

<div class="casual" style="
width: 100%;
background-color: rgba(255, 255, 255, 0.72);
display: block;
z-index: 1000;
border-bottom: 3px solid rgb(191, 191, 191);
position: fixed;
font-size: 15px;
">

<p style="text-align: center;color: black;margin: 0.7em;"> <span style="font-family: &quot;ArialRMB&quot;; " arialrmb";"="">exampleExample</span> will be at <img src="http://ourgang62.com/images/photo_gallery.jpg" style="
vertical-align: middle;
width: 9em;
"> 2015 in San Francisco, August 11th - 13th <a href="mailto:banana@example.com" id="casual-analytics"><img src="http://ourgang62.com/images/photo_gallery.jpg" style="
width: 9em;
margin-left: 2em;
vertical-align: text-bottom;
"></a>

<span id="casualx" style="
float: right;
cursor: pointer;
"> X </span>

</p>

</div>

http://jsfiddle.net/4468ekjy/2/

最佳答案

将图像位置设置为相对位置,因为它将相对于您的 div

关于html - 如何在中间对齐文本和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30915715/

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