html - 试图在同一行上有一个标题和无序列表项
问题描述
我看了又看,尝试了不同的 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>
我需要的样机示例
关于如何实现这一目标的任何建议?
解决方案
您需要做的就是在 CSS 部分中使用以下内容
h4{
display: inline;
}
推荐阅读
- docker - 创建机器时出错:机器创建期间驱动程序出错:无法启动 VM:Windows-10 上的 Docker 安装
- android - Android - 指定每个片段的主题
- swift - swift中的奇怪字典
- php - App Engine - PHP Symfony - 如何要求使用 app.yaml 登录
- c# - MongoDB C#驱动程序如何更新更新文档的集合
- c# - ShaderGraph 材质颜色变化
- node.js - EJS/Node/Express - 有一个部分标题,如何更改每个页面的标题?
- angular - 如何正确使用 mat-autocomplete 和远程 graphQL 数据?
- unity3d - 着色器图,纹理不循环
- r - R中的子集字符串