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 ...
随机推荐
- java字符乱码
在java中处理字符时,经常会发生乱码,而主要出现的地方在读取文本文件时发生,或者是写入到文件中,在其他地方打开乱码. 如下例子: BufferedReader br = null; try { br ...
- node中的cmd规范
你应该熟悉nodejs模块中的exports对象,你可以用它创建你的模块.例如:(假设这是rocker.js文件) exports.name = function() { console.log('M ...
- Partition1:新建分区表
未分区的表,只能存储在一个FileGroup中:对Table进行分区后,每一个分区都存储在一个FileGroup,或分布式存储在不同的FileGroup中.对表进行分区的过程,是将逻辑上完整的一个表, ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(64)-WebApi与Unity注入
系列目录 前言: 有时候我们系统需要开放数据给手机App端或其他移动设备,不得不说Asp.net WebApi是目前首选 本节记录Asp.net MVC WebApi怎么利用Unity注入.系列开头已 ...
- [C#] C# 知识回顾 - 你真的懂异常(Exception)吗?
你真的懂异常(Exception)吗? 目录 异常介绍 异常的特点 怎样使用异常 处理异常的 try-catch-finally 捕获异常的 Catch 块 释放资源的 Finally 块 一.异常介 ...
- MAVEN学习-第一个Maven项目的构建
MAVEN安装成功之后就可以进行项目的构建和管理了: 为什么要用maven进行项目的构建和管理? 对于初学者来说一个最直接的也是最容易里的优点在于JAR包的管理,相对于以前开发一个项目的时候我们需要用 ...
- cesium自定义气泡窗口infoWindow
一.自定义气泡窗口与cesium默认窗口效果对比: 1.cesium点击弹出气泡窗口显示的位置固定在地图的右上角,默认效果: 2.对于习惯arcgis或者openlayer气泡窗口样式的giser来说 ...
- SNMP简单网络管理协议
声明:以下内容是学习谌玺老师视频整理出来(http://edu.51cto.com/course/course_id-861.html) SNMP(Simple Network Management ...
- git
CMD命令:git initgit add . [添加文件至暂存区]git commit -m '描述性语句 随意写即可'git branch gh-pages [创建仓库分支]git checkou ...
- ZooKeeper简介
本文中,我们将对ZooKeeper进行介绍.简单地说,ZooKeeper是一个用来在构成应用的各个子服务之间进行协调的一个服务. 由于其本身并没有特别复杂的机制,因此我们将会把更多的笔墨集中在如何对Z ...