【问题标题】:how to squish text together in css?如何在css中将文本压缩在一起?
【发布时间】:2020-07-29 10:15:50
【问题描述】:

想知道如何将我的文本压缩在一起?所以它没有推到页面之外?有什么建议吗?


问题:


代码:

.Subheading{
    text-align:center;
    font-family: 'Mukta', sans-serif;
    margin-top:70px;
    margin-left:-500px;
    font-size:30px;
}
<p class="Subheading">Thanks for you the family of the random of the screen of the something yes ok no understood no what nevermind.</p>

提前致谢!

【问题讨论】:

  • 删除这个margin-left:-500px;
  • 我希望它是这样的,在屏幕的左侧,但是你看,我是一直向下而不是向侧面的文字,我可以这样做吗?
  • 寻求代码帮助的问题必须包含最短代码以便在问题本身中包含重现它所必需的最好是Stack Snippet。见How to create a Minimal, Reproducible Example。我们需要看到确切的问题

标签: html css text


【解决方案1】:

您可以添加 500px 的内边距来抵消-500px 的边距。 如果这对您不起作用,请提供更多详细信息。

.Subheading{
    text-align:center;
    font-family: 'Mukta', sans-serif;
    margin-top:70px;
    margin-left:-500px;
    padding-left:500px;
    font-size:30px;
    text-align: left;
}
<p class="Subheading">Thanks for you the family of the random of the screen of the something yes ok no understood no what nevermind.</p>

【讨论】:

  • 这有点像我想要的,你看到当我按下运行 sn-p 时,它会向下,但我想要完全相同的向下,但就像聚在一起,但就像在屏幕的左侧. (你可以在亚马逊等著名网站上看到很多)
  • 你的意思是左对齐吗?现在看。
  • 在某种程度上,是的,所以就像我想要那种聚集在一起的文本,但就在屏幕的左侧。 (遗憾的是,我不知道这个术语)。
猜你喜欢
  • 1970-01-01
  • 2021-01-16
  • 1970-01-01
  • 1970-01-01
  • 2021-09-12
  • 2011-06-26
  • 1970-01-01
  • 2020-01-17
  • 1970-01-01
相关资源
最近更新 更多