如何将这些单词与CSS放在同一行?

时间:2018-10-12 13:11:35

标签: html css

我想将these words放在同一行。我尝试了所有display选项,也尝试了text-align。什么都没用。

摘要

<h3 id="trying">
        If you have time, you should read more about this incredible human being on his 
      <a href="https://en.wikipedia.org/wiki/Norman_Borlaug" target="_blank">
        Wikipedia Entry
      </a>.
    </h3>

2 个答案:

答案 0 :(得分:0)

一种简单的方法是增加h3标签的宽度,因为h3标签是块类型元素

h3{
width:900px;
}
<h3 id="trying">If you have time, you should read more about this incredible human being on his <a href="https://en.wikipedia.org/wiki/Norman_Borlaug" target="_blank">Wikipedia Entry</a>.</h3>

答案 1 :(得分:0)

您应该注意最有可能引起问题的容器width

#trying{
   width:100%
}

它将与父容器相同。