如何修复在我的WordPress网站上字体阴影和字体描边显示不正常?

huangapple go评论73阅读模式
英文:

How can I fix font shadow and font stroke not appearing properly on my WordPress website?

问题

I'm building a website on WordPress and upon trying to change the font shadow and font stroke, the changes do not appear properly on the webpage.

For my title, I wrote this CSS:

.wp-block-heading-h1 {
	text-decoration: underline dotted purple;
	text-shadow: black -4px 5px;
	-webkit-text-stroke: 2px black;
	color: white;
}

The output is this:

如何修复在我的WordPress网站上字体阴影和字体描边显示不正常?

Whereas, upon highlighting, I get this which should be the expected output:

如何修复在我的WordPress网站上字体阴影和字体描边显示不正常?

英文:

I'm building a website on WordPress and upon trying to change the font shadow and font stroke, the changes do not appear properly on the webpage.

For my title, I wrote this CSS:

.wp-block-heading-h1 {
	text-decoration: underline	dotted purple;
	text-shadow: black -4px 5px;
	-webkit-text-stroke: 2px black;
	color: white;
}

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

.wp-block-heading-h1 {
	text-decoration: underline	dotted purple;
	text-shadow: black -4px 5px;
	-webkit-text-stroke: 2px black;
	color: white;
}

<!-- language: lang-html -->

&lt;h1 class=&quot;wp-block-heading-h1&quot;&gt;S. CRAP&lt;/h1&gt;

<!-- end snippet -->

The output is this:

如何修复在我的WordPress网站上字体阴影和字体描边显示不正常?

Whereas, upon highlighting I get this which should be the expected output:

如何修复在我的WordPress网站上字体阴影和字体描边显示不正常?

答案1

得分: 1

你可以使用以下的CSS代码来达到期望的效果:

.wp-block-heading-h1 {
    text-decoration: underline dotted #fff;
    text-shadow: black -3px 1px;
    -webkit-text-stroke: 1px #000;
    color: #fff;
    font-family: sans-serif;
    background-color: coral;
    display: inline;
}

你的输出将会像这样:

<h1 class="wp-block-heading-h1">S. CRAP</h1>

希望这对你有帮助!

英文:

You can use the below CSS to achieve the expected result:

<!-- begin snippet: js hide: false console: true babel: null -->

<!-- language: lang-css -->

.wp-block-heading-h1 {
    text-decoration: underline dotted #fff;
    text-shadow: black -3px 1px;
    -webkit-text-stroke: 1px #000;
    color: #fff;
    font-family: sans-serif;
    background-color: coral;
    display: inline;
}

<!-- language: lang-html -->

&lt;h1 class=&quot;wp-block-heading-h1&quot;&gt;S. CRAP&lt;/h1&gt;

<!-- end snippet -->

Your output would look like this:

<img src="https://i.stack.imgur.com/jv5tS.png" width="270">

huangapple
  • 本文由 发表于 2023年5月24日 23:05:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76324962.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定