Home > Web Front-end > CSS Tutorial > How to achieve font stroke effect in css

How to achieve font stroke effect in css

王林
Release: 2020-11-13 17:30:03
Original
3476 people have browsed it

How to achieve font stroke effect in css: You can use the text-stroke attribute to achieve font stroke effect, such as [-webkit-text-stroke:6px transparent;]. The text-stroke attribute is often used in conjunction with the text-fill-color attribute.

How to achieve font stroke effect in css

text-stroke is the abbreviation of text-stroke-width and text-stroke-color (fill color for text).

(Learning video sharing: css video tutorial)

The text-stroke attribute is often used in conjunction with text-fill-color (the text-fill-color attribute is to fill the text with color )use together.

Example:

Gradient text stroke effect, set text-stroke-color to transparent:

h2{
      background:-webkit-linear-gradient(red, blue);
      -webkit-background-clip: text;
      -webkit-text-fill-color:#fff;
      -webkit-text-stroke:6px transparent;
    }
Copy after login

Same principle, if you replace the above background image with Picture, you can also create a stroke effect with the picture as the base:

h3{
      background:url(bingzhang.jpg);
      -webkit-background-clip: text;
      -webkit-text-fill-color:#fff;
      -webkit-text-stroke:6px transparent;
    }
Copy after login

The effect is as follows:

How to achieve font stroke effect in css

##Related recommendations:

CSS tutorial

The above is the detailed content of How to achieve font stroke effect in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template