惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 叶小钗
F
Fortinet All Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 最新话题
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
PCI Perspectives
PCI Perspectives
Cloudbric
Cloudbric
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
IT之家
IT之家
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
J
Java Code Geeks
M
MIT News - Artificial intelligence
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
Microsoft Security Blog
Microsoft Security Blog
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
G
Google Developers Blog
W
WeLiveSecurity
罗磊的独立博客
P
Privacy & Cybersecurity Law Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
T
Tailwind CSS Blog
V
Visual Studio Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Secure Thoughts
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Full Disclosure
Blog — PlanetScale
Blog — PlanetScale
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed

博客园 - Blueeyes

挺有意思的小工具。。。 JS调用c#编写的DLL 笔记本CPU大全 搜集整理的一些SQL语句 .NET程序脱离.NET框架的方法 ASP.NET3.5的ListView与CSS Friendly ASP.NET页面中标题单点解决方案 微软一个罕为人知的无敌命令ntsd 微软一个罕为人知的无敌命令ntsd 全国主要城市的DNS服务器列表 静态构造器四个准则 .NET 中的对象序列化 .NET 中的数字格式化,日期格式化 别有用心的SQL 向水晶报表传递参数 在GridView的中有一个DropDownList,并且DropDownList有回传事件 Excel轻松合并 写了一个查看SQL表结构的小工具 gridview的简单示例 (个人收藏)
纯CSS文字阴影效果实现
Blueeyes · 2007-03-13 · via 博客园 - Blueeyes

CSS2中的text-shadow属性能够很容易的给web页面中的文本添加阴影,但是到目前为止只有OS X的Safari浏览器支持它,今天,我们将为其他浏览器创建CSS文本阴影效果,包括Firefox。 
讨论了多年的text-shadow属性可以让你控制页面元素阴影的颜色、偏移量及模糊度,尽管其还未被广泛支持,但是某些设计师已经开始决定在任意地方使用CSS text-shadows属性了。尽管这只是为很少数量的用户增强性设计。 
CSS Text-Shadows Safari实现 
如果你使用的是Safari,你将可以看到在白色的背景上有阴影的白色文本: 
This is white text, on a white background. Yet in Safari, you can read this, because of the black text-shadow. 
如果你不是使用Safari,一下是效果图: 

浏览器通用CSS文本阴影 
Firefox是个伟大的浏览器,但是它不支持以上的效果,所以我决定用CSS实现一个类似的效果,虽然没有前面你看到的text-shadow属性效果完美,但是该方法适用于更大范围的浏览器,包括Safari。 

This is white text, on a white background. Yet with CSS Drop Shadows, you can read this, because of the black text-shadow. 

HTML代码 
要添加阴影效果,我们在我们的例子段落中创建了个title属性内容是需要投影的文本的内容一致。因为在该方法中我们重复了文本,所以该方法更适合在标题或文本比较短的段落中,而不适合整个页面的阴影效果。 

<p class="shadow" title="This is white text, on a white background. Yet with CSS Drop Shadows, you can read this, because of the black text-shadow."><span>This is white text, on a white background. Yet with CSS Drop Shadows, you can read this, because of the black text-shadow.</span></p>

我们在段落中增强了个<span>标签用来控制正常的文本的位置以将其与生成的阴影区分开。 
The CSS 
CSS :before 虚拟元素用来从段落的title属性中生成阴影,而绝对(absolute)定位用来将正常文本放置于阴影文本之上。 

.shadow  { position:relative; display:block; color:#fff; }.shadow span { position:absolute; display:block; top:0px;  }.shadow: 
before { display:block; padding:1px; content: attr(title); color:#666;  } 

你可以使用position:absolute控制在相对定位(position:relative)的元素内部的元素的位置。该技能使得我们可以控制正常文本和阴影文本的放置,而又可以在原来的文本流程中使用该元素。 
你可以在.shadow中控制文本及阴影的背景颜色、字体等属性,而可以在.shadow:before中使用padding属性控制阴影的偏移值,使用color设置阴影的颜色等。