Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
111 views
in Technique[技术] by (71.8m points)

html - Real outline for text

Is there any way to outline text in my website? I am working on a project and I want to have outlined text, but I just could not find a real solution, lot of people are saying that I should use text-shadow and some other people are saying that "SVG" is better.

Is there a real solution?

question from:https://stackoverflow.com/questions/65648008/real-outline-for-text

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

.stroke {
  -webkit-text-stroke: 2px limegreen;
  color: transparent;
}

.stroke-explicit {
  -webkit-text-stroke-width: 2px;
  -webkit-text-stroke-color: red;
  color: transparent;
}

h1 {
  font-size: 60px;
}
<h1 class="stroke">Shorthand</h1>
<h1 class="stroke-explicit">Both properties</h1>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...