gpt4 book ai didi

html - CSS:文本装饰无法删除上划线

转载 作者:技术小花猫 更新时间:2023-10-29 12:53:00 29 4
gpt4 key购买 nike

<分区>

我正在尝试使用 p::first-letter 选择器从第一个字母中删除文本装饰。但由于某些未知原因,我无法做到这一点。

p::first-line {
font-weight: bold;
text-decoration: overline;
}
p::first-letter {
text-decoration: none;
/*text-decoration-color: rgba(59, 119, 191, 0.68);*/
display: block;
color: red;
font-weight: bold;
background-color: rgba(59, 119, 191, 0.68);
margin: 0px 2px 1px 0;
padding: 5px 13px 5px 11px;
color: #b1ffea;
}
<h2>Heading <a href="#"><span class="anchor">#</span></a></h2>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur eaque enim eveniet facere incidunt inventore necessitatibus non quas, repellat sed ullam unde ut vitae! Asperiores ducimus laborum magnam officia repellendus.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis ipsum laborum sunt voluptate voluptates voluptatum. A architecto beatae delectus eos itaque magnam nostrum perferendis, provident quis quos repellendus similique vitae!
Lorem ipsum dolor sit amet, consectetur <a href="#">some link</a> adipisicing elit. Ducimus itaque numquam voluptatem. Ad aspernatur consequuntur deserunt et expedita facilis id, iste maxime minus nisi odit quaerat quisquam quod tempora velit?
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos <a href="#">another link</a> illo iure magni odio quas, sint totam ut. Aliquam ipsa recusandae voluptatem! A consectetur deserunt eos quaerat rerum. Dolores, quod voluptatem.</p>

更新:

好的,我通过启用“实验性 Web 平台功能”让它在 Chrome 上运行。由于某些原因,前缀 -webkit- 无法触发此行为。这是工作代码。

p::first-letter{
text-decoration: overline;
text-decoration-color: rgba(59, 119, 191, 0.68);
display: block;
color: red;
font-weight: bold;
background-color: rgba(59, 119, 191, 0.68);
margin: 0px 2px 1px 0;
padding: 5px 13px 5px 11px;
color: #b1ffea;
}

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