微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

试图在同一行上有一个标题和无序列表项

如何解决试图在同一行上有一个标题和无序列表项

我已经看了又看,并尝试了不同的 CSS 变体,但到目前为止都没有成功。

不确定这是否可能,但尝试在无序列表项中包含 H4 和内容

我可以将 H4 添加到列表项中,但在标题之后,内容继续从下一行开始,如“我一直在获取示例的问题模型”所示。我试图将内容与H4保持在同一行,如果字符太多,则文本可以转到下一行。

代码示例

<ul>
<li><h4>H4 Headline</h4> - This is the text that will start on the same line as the headline. This is the text that will start on the same line as the headline. This is the text that will start on the same line as the headline.</li>
<li><h4>H4 Headline</h4> - This is the text that will start on the same line as the headline. This is the text that will start on the same line as the headline. This is the text that will start on the same line as the headline.</li>
<li><h4>H4 Headline</h4> - This is the text that will start on the same line as the headline. This is the text that will start on the same line as the headline. This is the text that will start on the same line as the headline.</li>
</ul>

我需要的样机示例

enter image description here

我不断得到的问题模型

enter image description here

关于如何实现这一目标有什么建议吗?

解决方法

您需要做的就是在 CSS 部分使用以下内容

h4{
   display: inline;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。