gpt4 book ai didi

HTML, CSS 编辑

转载 作者:行者123 更新时间:2023-11-28 13:52:41 25 4
gpt4 key购买 nike

我写了一些 html 代码,想用 css 编辑它的 View

                <div id="contact_4" name="contact" >
<input type="checkbox" id="chk_4" class="contactChk"/>
<img height="25" width="25" alt="" src="Images/Contacts/1.jpg" style="width: 30px; height: 35px;"/>
<span class="contactItem" id="contactName_4" name="contactName">
Amr ElGarhy
</span>
<img src="Images/Common/Motiva.png" alt=""/>
<br/>
</div>

alt text http://igurr.com/resized-image.ashx/__size/500x400/__key/CommunityServer.Components.PostAttachments/00.00.00.01.73/OneContact.JPG

我想做的是使文本和图像在主 div 中垂直对齐,如果有人知道如何在不使用任何表格和仅使用 CSS 的情况下这样做,请告诉我是否必须编辑 html 本身。

更新:我希望主分区中的所有内容都垂直居中对齐。正如您在图像中看到的那样,文本、复选框和 2 个图像默认情况下底部对齐,我想覆盖它。

最佳答案

这样做:

#contact_4 * {      
vertical-align: middle;
display: inline;
}

“显示:内联;”如果您没有其他样式更改这些元素显示类型,则没有必要。

附言div 和 span 元素没有“名称”属性。

关于HTML, CSS 编辑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/574713/

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