HTML - 并排放置标题

标签 html css

我似乎无法将两个标题并排放在同一行中。而且,我想将标题对齐到页面的中心。

需要这方面的帮助。

.inline-div {
  display: inline;
}

h4
{
  text-align: center;
}
<div class="inline-div">
  <h4>Product Tested :</h4>
  <h4>Profile Tested :</h4>
</div>

最佳答案

.inline-div {
  display: block;
  text-align: center;
}

h4
{
  display: inline-block;
  text-align: center;
}
<div class="inline-div">
  <h4>Product Tested :</h4>
  <h4>Profile Tested :</h4>
</div>

关于HTML - 并排放置标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46230992/

相关文章:

html - 并排创建不同尺寸的 img 和 p 标签

html - 当将宽度设置为 100% 时,输入文本元素流出容器元素

css - IE CSS 错误 : IMG original height affecting parent height

html - 删除点击区域的蓝色边框

html - CSS 未被读取 WP

css - 压缩导航链接或固定它们占用空间的技术,这样它们就不会奇怪地环绕

javascript - 如何隐藏单选按钮直到有事情发生?

javascript - "Converting"jQuery 到纯 JavaScript

html - 两个 Div 之间的固定宽度间隙

html - CSS 清除 float 不起作用