gpt4 book ai didi

javascript - HTML - CSS 样式 : Having separate colored elements on the same line

转载 作者:太空宇宙 更新时间:2023-11-03 20:10:13 26 4
gpt4 key购买 nike

我试图让蓝色“65”与标题“其他”位于同一行。我已经包括了一张图片以及当前的 html。

图片:

enter image description here

HTML:

<h3 id="otherHead" class="groupHeader">Other <div style="color: #5191CD;">65</div></h3>

我有一个将“65”注入(inject)标题的脚本,该脚本有效,但我想让“65”具有不同的颜色并与“其他”位于同一行,而无需使用表格。谢谢!

最佳答案

添加显示内联 block ;

<h3 id="otherHead" class="groupHeader">Other <div style="color: #5191CD; display: inline-block;">65</div></h3>

您不应该直接针对元素设置样式。考虑将您的元素样式移动到 CSS 样式表中。

关于javascript - HTML - CSS 样式 : Having separate colored elements on the same line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36014994/

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