[CSS3] Target HTML Elements not Explicitly set in the DOM with CSS Pseudo Elements (Blockquotes)
Pseudo elements allow us to target elements that are not explicitly set in the DOM. Using ::before ::after
we can actually create and manipulate elements in the DOM that do not impact the content. While ::first-letter ::first-line ::selection ::placeholder
allow us to target elements that do not have a specific DOM element.
blockquote {
quotes: "“" "”" "‘" "’";
} blockquote::before {
content: open-quote;
}
blockquote::after {
content: close-quote;
}
About ::first-line, ::first-letter:
p::first-line {
color: green;
} p::first-letter {
font-size: 2em;
float: left;
line-height: 1.7em;
padding: 0 .3em;
font-weight: bold;
}
<div style="width:350px; margin: 0 auto; padding-top: 80px; padding-bottom: 80px;"> <div class="testimonial-quote ">
<div class="quote-container">
<blockquote>
<p>Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful, and professional team. Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful, and professional team. Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful, and professional team. Overall, fantastic! </p>
</blockquote>
<cite><span>Kristi Bruno</span></cite>
</div>
</div> </div> .testimonial-quote {
font-size: 14px;
} .testimonial-quote blockquote {
/* Negate theme styles */
border: 0;
margin: 0;
padding: 0; background: none;
color: gray;
font-family: Georgia, serif;
font-size: 1.25em;
font-style: italic;
line-height: 1.4 !important;
margin: 0;
position: relative;
text-shadow: 0 1px white;
z-index: 600;
} .testimonial-quote blockquote * {
box-sizing: border-box;
} .testimonial-quote blockquote p {
color: #75808a;
line-height: 1.2 !important;
} .testimonial-quote blockquote p:first-child:before {
content: '\201C';
color: #81bedb;
font-size: 6em;
font-weight: 700;
opacity: .3;
position: absolute;
top: -.4em;
left: -.2em;
text-shadow: none;
z-index: -300;
} .testimonial-quote cite {
color: gray;
display: block;
font-size: .8em;
} .testimonial-quote cite span {
color: #5e5e5e;
font-size: 1em;
font-style: normal;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
text-shadow: 0 1px white;
} .testimonial-quote {
position: relative;
} .testimonial-quote cite {
text-align: right;
}
img {
background-color: red;
}
[CSS3] Target HTML Elements not Explicitly set in the DOM with CSS Pseudo Elements (Blockquotes)的更多相关文章
- [TypeStyle] Style CSS pseudo elements with TypeStyle
Just like pseudo-classes, pseudo-elements are added to selectors but instead of describing a special ...
- CSS3 target 伪类不得不说那些事儿(纯CSS实现tab切换)
是不是觉得target有点眼熟?! 今天要讲的不是HTML的<a>标签里面有个target属性. target伪类是css3的新属性. 说到伪类,对css属性的人肯定都知道:hover.: ...
- CSS3 target伪类简介
CSS3 target伪类是众多实用的CSS3特性中的一个.它用来匹配文档(页面)的URI中某个标志符的目标元素.具体来说,URI中的标志符通常会包含一个”#”字符,然后后面带有一个标志符名称,比如# ...
- CSS3 :target伪类的理解与使用
CSS3 :target伪类用来改变页面中锚链接URL所指向的ID元素的样式,例如你要改变描链接指向#tab的元素字体颜色为蓝色,哪么你可以这样写成#tab:target {color:blue} 浏 ...
- 巧用CSS3 :target 伪类制作Dropdown下拉菜单(无JS)
:target 是CSS3 中新增的一个伪类,用以匹配当前页面的URI中某个标志符的目标元素(比如说当前页面URL下添加#comment就会定位到id=“comment”的位置,俗称锚).CSS3 为 ...
- target属性用于返回最初触发事件的DOM元素。
target属性用于返回最初触发事件的DOM元素. 在HTML文档中,我们为<p>元素绑定点击事件("click"),由于DOM元素的事件冒泡机制,我们点击<p& ...
- CSS3 :target伪类实现Tab切换效果
用:target伪类实现Tab切换效果真的非常简单!简单到什么程度呢?它只需要下面这些代码. style.css: .song-info { position: absolute; backgroun ...
- CSS3 :target伪类实现Tab切换效果 BY commy
http://www.shejidaren.com/examples/css3-target/css3-target.html#tab1 标签一 标签二 标签三 欢迎加设计达人Q群:50063010设 ...
- css3 - target
通过CSS3伪元素target,我们可以实现拉风琴 源码 <!DOCTYPE HTML> <html lang="en-US"> <head> ...
随机推荐
- python爬虫(爬取图片)
python爬虫爬图片 爬虫爬校花网校花的图片 第一步 载入爬虫模块 #载入爬虫模块 import re #载入爬虫模块 import requests #载入爬虫模块 第二步 获得校花网的地址,获得 ...
- Python 描述符(Descriptor) 附实例
在 Python 众多原生特性中,描述符可能是最少被自定义的特性之一,但它在底层实现的方法和属性却无时不刻被使用着,它优雅的实现方式体现出 Python 简洁之美. 定义 一个描述符是一个有" ...
- linux 系统备份还原
操作系统或文件备份 tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude ...
- 基于注解实现SpringBoot多数据源配置
1.功能介绍 在实际的开发中,同一个项目中使用多个数据源是很常见的场景.最近在学习的过程中使用注解的方式实现了一个Springboot项目多数据源的功能.具体实现方式如下. 2.在applicatio ...
- php官方微信接口大全
微信入口绑定,微信事件处理,微信API全部操作包含在这些文件中.内容有:微信摇一摇接口/微信多客服接口/微信支付接口/微信红包接口/微信卡券接口/微信小店接口/JSAPI <?php class ...
- Codeforces Round #352 (Div. 1) B. Robin Hood
B. Robin Hood 讲道理:这种题我是绝对不去(敢)碰的.比赛时被这个题坑了一把,对于我这种不A不罢休的人来说就算看题解也要得到一个Accepted. 这题网上有很多题解,我自己是很难做出来的 ...
- scp命令(基于ssh上传文件等)
(转:http://www.cnblogs.com/hitwtx/archive/2011/11/16/2251254.html) svn 删除所有的 .svn文件 find . -name .svn ...
- 【Luogu】P1393动态逆序对(树套树)
题目链接 树套树. 每次删掉x的时候会减去1到x-1里比x位置的数大的数和它构成的逆序对,以及x+1到n里比x位置的数小的数和它构成的逆序对. 顺带一提我发现平衡树insert的时候不是要splay一 ...
- [图论训练]BZOJ 1624: [Usaco2008 Open] Clear And Present Danger 寻宝之路【floyd】
Description 农夫约翰正驾驶一条小艇在牛勒比海上航行. 海上有N(1≤N≤100)个岛屿,用1到N编号.约翰从1号小岛出发,最后到达N号小岛.一 张藏宝图上说,如果他的路程上 ...
- P1122 最大子树和 (树形DP)
题目描述 小明对数学饱有兴趣,并且是个勤奋好学的学生,总是在课后留在教室向老师请教一些问题.一天他早晨骑车去上课,路上见到一个老伯正在修剪花花草草,顿时想到了一个有关修剪花卉的问题.于是当日课后,小明 ...