css text-fill-color与text-stroke讲解
顾名思义“text-fill-color”就是文字填充颜色而“text-stroke”就是文字描边。还别说,两个属性可以制作出各种炫酷的文字效果,不过IE系列都不支持,不过好在webkit都支持良好。
text-fill-color:color;
<style>
h1{
-webkit-text-fill-color:red;
}
</style>
<h1>博客园</h1>
话说倒有点像color
了,这种情况下倒是和color
真的是一样的。
得注意一下:如果同时设置了
text-fill-color
和color
那么color
不会起作用。
h1{
-webkit-text-fill-color:red;
color:green;
}
text-stroke:width color;
<style>
h1{
-webkit-text-stroke:1px red;
}
</style>
<h1>博客园</h1>
好像这两个单独使用没有啥亮点,但如果结合起来使用那就不一样了。
text-stroke + text-fill-color制作文字镂空效果
<style>
body{
background-color:#000;
}
h1{
font-size:60px;
-webkit-text-fill-color:transparent;
-webkit-text-stroke:1px #fff;
}
</style>
<h1>博客园</h1>
原来就是设置边框为白色然后然文字颜色透明,背景颜色黑色,也就是黑白对比,自然文字就只能看见边框了。
如果再结合一下“background-clip”那就更强大了。
background-clip:text
结合text-fill-color
制作文字渐变效果
h1{
font-size:60px;
background: linear-gradient(to bottom,#FCF,#000);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
}
注意:
background-clip
必须放在background
后面不然不起作用,之所以要用background
是因为text-fill-color
不能使用linear
所以只好借助background
了。
background-clip:text会将背景作为文字区域裁剪。
<style>
h1{
font-size:60px;
background: url(bg.jpg) repeat;
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
}
</style>
<h1>博客园</h1>
利用animation制作文字遮罩动画效果
<style>
h1{
font-size:60px;
background: url(bg.jpg) repeat;
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
animation:fn 5s alternate infinite;
}
@keyframes fn{
0%{
background-position:0px 0px;
}
20%{
background-position:30% 0px;
}
50%{
background-position:50% 0px;
}
70%{
background-position:70% 0px;
}
100%{
background-position:100% 0px;
}
}
</style>
<h1>博客园</h1>
待续...
css text-fill-color与text-stroke讲解的更多相关文章
- css text gradient color, css fonts gradient color
css text gradient color, css fonts gradient color css 字体渐变色 demo https://codepen.io/xgqfrms/pen/OJya ...
- 简单CSS实现闪烁动画(+1白话讲解)
原文:简单CSS实现闪烁动画(+1白话讲解) 本文转载于:猿2048网站⇒https://www.mk2048.com/blog/blog.php?id=icj2chj2ab 背景 本文承接自上文&l ...
- 论文阅读(Zhuoyao Zhong——【aixiv2016】DeepText A Unified Framework for Text Proposal Generation and Text Detection in Natural Images)
Zhuoyao Zhong--[aixiv2016]DeepText A Unified Framework for Text Proposal Generation and Text Detecti ...
- css系列教程--color direction line-height letter-spacing
css标签:colorcolor:用法color:指定文本的颜色color:red/#fff/unicode; direction:用法 direction:定义文本的方向.dirction:ltr/ ...
- "text"和new String("text")的区别
转自:What is the difference between “text” and new String(“text”)? new String("text"); expli ...
- scrollTo(String text) and scrollToExact(String text) method of Android Driver not working
Using the scrollTo(String text) and scrollToExact(String text) method of Android Driver. However the ...
- CSS border gradient color All In One
CSS border gradient color All In One CSS Gradient Borders border-image-source & border-image-sli ...
- sublime text less安装踩坑图文讲解(less无法生成css)
唉,怎么感觉做个前端几乎把所有的坑都踩遍了啊,别人按照网上安装了一遍就好使,我这里就死活不行. 先说一下我的问题:网上说的能安装的都按了,可是sublime就是不给我生成css文件,后来知道了,就是l ...
- Python+Selenium 利用ID,XPath,tag name,link text,partial link text,class name,css,name定位元素
使用firefox浏览器,查看页面元素,我们以“百度网页”为示例 一.ID定位元素 利用find_element_by_id()方法来定位网页元素对象 ①.定位百度首页,输入框的元素 ②.编写示 ...
- Sublime text —— 自定义Color theme
网上下载,XXX.tmTheme 样式,让后放置于 C:\Users\{用户名}\AppData\Roaming\Sublime Text 2\Packages\Color Scheme - Defa ...
随机推荐
- ABP入门系列(1)——学习Abp框架之实操演练
作为.Net工地搬砖长工一名,一直致力于挖坑(Bug)填坑(Debug),但技术却不见长进.也曾热情于新技术的学习,憧憬过成为技术大拿.从前端到后端,从bootstrap到javascript,从py ...
- AndroidTips-052:.aar文件依赖
aar aar 文件是android 类库项目的输出文件,其中可以包含普通的.class,清单,以及android项目特有的资源文件. 使用方式 将.aar文件放在在自己项目的libs目录下 在gra ...
- 46张PPT讲述JVM体系结构、GC算法和调优
本PPT从JVM体系结构概述.GC算法.Hotspot内存管理.Hotspot垃圾回收器.调优和监控工具六大方面进行讲述.(内嵌iframe,建议使用电脑浏览) 好东西当然要分享,PPT已上传可供下载 ...
- mybatis plugins实现项目【全局】读写分离
在之前的文章中讲述过数据库主从同步和通过注解来为部分方法切换数据源实现读写分离 注解实现读写分离: http://www.cnblogs.com/xiaochangwei/p/4961807.html ...
- JVM类加载
JVM的类加载机制就是:JVM把描述类的class文件加载到内存,并对数据进行校验.转换解析和初始化,最终形成可以被JVM直接使用的Java类型 ClassLoader JVM中的ClassLoade ...
- 【工具使用】mac电脑使用技巧
本文地址 分享提纲: 1. mac命令行和finder的交互 2. 一些mac的插件 3. 一些开发的配置 1.mac命令行和findder交互 1)命令行中打开当前文件夹: o ...
- TYPESDK手游聚合SDK服务端设计思路与架构之一:应用场景分析
TYPESDK 服务端设计思路与架构之一:应用场景分析 作为一个渠道SDK统一接入框架,TYPESDK从一开始,所面对的需求场景就是多款游戏,通过一个统一的SDK服务端,能够同时接入几十个甚至几百个各 ...
- const let,console.log('a',a)跟console.log('a'+a)的区别
const 创建一个只读的常量 let块级作用域 const let重复赋值都会报错 console.log('a',a) a console.log('a'+a) a2 逗号的值会有空格:用加号的值 ...
- 【干货分享】流程DEMO-补打卡
流程名: 补打卡申请 业务描述: 当员工在该出勤的工作日出勤但漏打卡时,于一周内填写补打卡申请. 流程相关文件: 流程包.xml 流程说明: 直接导入流程包文件,即可使用本流程 表单: 流程: 图片 ...
- 萌新笔记——vim命令“=”、“d”、“y”的用法(结合光标移动命令,一些场合会非常方便)
vim有许多命令,网上搜有一堆贴子.文章列举出各种功能的命令. 对于"="."d"."y",我在无意中发现了它们所具有的相同的一些用法,先举 ...