gpt4 book ai didi

css - 如何使用 CSS 格式化文本

转载 作者:行者123 更新时间:2023-11-27 22:33:09 24 4
gpt4 key购买 nike

我想知道如何对齐我的文本,以便它以我想要的方式显示。有人可以帮助我使用 CSS 像示例 2 中那样显示文本吗?

这是我的文本在做什么。

Name: At vero eos et 
accusamus et iusto odio dignissimos d

这是我想要它做的。

Name: At vero eos et 
accusamus et iusto odio dignissimos d

HTML 标记。

<div><p><span>Name:</span> At vero eos et 
accusamus et iusto odio dignissimos d</p></div>

最佳答案

<style>
div{
font-family:"Courier New", Courier, monospace;
margin-left: 65px;
}
span{
margin-left: -65px;
}
</style>

希望你能放一个<br />在每个换行符的末尾。如果你有 PHP,你可以使用 nl2br()

可以看到结果和代码@http://jsfiddle.net/Sghym/

关于css - 如何使用 CSS 格式化文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3315221/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com