Chrome h1标题上的波浪下划线未显示[已关闭]

dy1byipe  于 2023-06-19  发布在  Go
关注(0)|答案(2)|浏览(108)

**关闭。**此题需要debugging details。目前不接受答复。

编辑问题以包括desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将帮助其他人回答这个问题。
2天前关闭。
Improve this question
我创建了一个带有段落和标题的html文件,然后我创建了一个CSS文件,用于装饰html文件,使用h1标题的文本装饰属性,我遇到了错误。
我在我的CSS文件中使用了文本装饰属性,但即使在使用波浪形,虚线,虚线类型的线条后,Chrome也只在H1标题处显示简单的下划线..请解释原因..

dldeef67

dldeef671#

我在短短几分钟内就找到了自己问题的答案,这就是所谓的解决问题思维的力量。所以问题是波浪形、点线、虚线、双曲线等。Chrome浏览器或其他浏览器未显示下划线。答案是,通过在所有类型后面加上下划线,如:text-decoration=波浪下划线;或放置点线、虚线、双曲线等。在下划线之前,我们可以得到我们想要的下划线来显示。

bksxznpy

bksxznpy2#

text-decoration是一个简写属性

  • 文本装饰色
  • 文本装饰线
  • 文饰式
  • 文字装饰厚度

你必须定义text-decoration-line,这是强制性的。其他属性是可选的。您可以使用短线或单独使用,但将短线与任何单个属性一起使用都会导致问题。text-decoration中属性的顺序并不重要。检查下面的代码片段:

h1{
text-decoration: underline wavy;
}
h2{
text-decoration:2px wavy underline red;
}
h3{
text-decoration-line: underline;
text-decoration-style: wavy;
text-decoration-color: green;
}
<div>
  <h1> This is a heading </h1>
  <h2> This is another heading </h2>
  <h3>This is  also a heading</h3>
</div>

相关问题