In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
这篇文章将为大家详细讲解有关css3文本阴影效果的示例分析,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
实例教程:
1.给标题添加阴影
h2
{
text-shadow: 5px 5px 5px #FF0000;
}
CSS3 box-shadow属性,CSS3 中 CSS3 box-shadow 属性适用于盒子阴影
div
{
box-shadow: 10px 10px 5px #888888;
}
2.接下来给阴影添加颜色
div
{
box-shadow: 10px 10px grey;
}
3.接下来再给阴影添加一个模糊效果
div
{
box-shadow: 10px 10px 5px grey;
}
你也可以在 ::before 和 ::after 两个伪元素中添加阴影效果
代码如下
#boxshadow {
position: relative;
b ox-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
pa dding: 10px;
bac kground: white;
}
#boxshadow img {
width: 100%;
border: 1px solid #8a4419;
border-style: inset;
}
#boxshadow::after {
content: '';
position: absolute;
z-index: -1; /* hide shadow behind image */
box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3); width: 70%;
left: 15%; /* one half of the remaining 30% */ height: 100px;
bottom: 0;
}
阴影的一个使用特例是卡片效果
div.card {
width: 250px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
text-align: center;
}
CSS3 Text Overflow属性,是CSS3文本溢出属性指定应向用户如何显示溢出内容。
代码如下
p.test1 {
white-space: nowrap;
width: 200px;
border: 1px solid #000000;
overflow: hidden;
text-overflow: clip;
}
p.test2 {
white-space: nowrap;
width: 200px;
border: 1px solid #000000;
overflow: hidden;
text-overflow: ellipsis;
}
CSS3 单词拆分换行属性指定换行规则
CSS代码如下
p.test1 {
word-break: keep-all;
}
p.test2 {
word-break: break-all;
}
关于"css3文本阴影效果的示例分析"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.