css的text-stroke属性

全能 AI 聚合平台 免费

一站式接入主流 AI 大模型,支持对话 · 生图 · 生视频,即开即用

ChatGPT Claude Gemini Grok DeepSeek 通义千问 Ollama
AI对话 AI生图 AI视频
免费使用 →

使用text-stroke文字的描边属性

text-stroke:描边大小 描边颜色;

配合color: transparent;既可以做到字体镂空的效果

css的text-stroke属性

<style>

    div {

        color: transparent;

    }

    .box1 {

        font-size: 30px;

        background-color: green;

        -webkit-text-stroke: 0.3px black;

    }

    .box2 {

        font-size: 18px;

        background-color: #c0c0c0;

        -webkit-text-stroke: 0.3px red;

    }

    .box3 {

        font-size: 12px;

        background-color: rgba(0, 26, 255, 0.418);

        -webkit-text-stroke: 0.1px yellow;

    }

</style>


<div class="box1">
    镂空字体
</div>
<div class="box2">
    镂空字体
</div>
<div class="box3">
 镂空字体
</div>

© 版权声明

相关文章

暂无评论

none
暂无评论...