[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爬虫基础05-beautifulsoup
HTML解析库BeautifulSoup4 本文链接:https://www.jianshu.com/p/e9255c446a77 BeautifulSoup 是一个可以从HTML或XML文件中提取数 ...
- python--基础数据类型的补充与深浅copy
一 . join的用法 lst =['吴彦祖','谢霆锋','刘德华'] s = '_'.join(lst) print(s) # 吴彦祖_谢霆锋_刘德华 # join() "*" ...
- Python的第二堂课(1)
一.编程语言的分类 机器语言:直接使用二进制命令去编写程序. 优点:执行效率高 缺点:开发效率低 汇编语言:用英文标签代替二进制命令去编写程序 优点:开发效率高于机器语言 缺点:执行效率低于机器语言 ...
- (转)UIPanGestureRecognizer
UIPanGestureRecognizer是UIGestureRecognizer类的一个扩展类,其扩展类有UITapGestureRecognizer,UIPinchGestureRecogniz ...
- gnu make规则记录
1. $(shell CMD) 名称: 执行 shell 命令函数 功能: 在新的 shell 中执行 CMD 命令 返回值: CMD 在 shell 中执行的结果 例如:PLATFORM=$(she ...
- 【RAID】raid1 raid2 raid5 raid6 raid10的优缺点和做各自raid需要几块硬盘
Raid 0:一块硬盘或者以上就可做raid0优势:数据读取写入最快,最大优势提高硬盘容量,比如3快80G的硬盘做raid0 可用总容量为240G.速度是一样.缺点:无冗余能力,一块硬盘损坏,数据全无 ...
- pytorch使用过程中遇到的一些问题
问题一 ImportError: No module named torchvision torchvison:图片.视频数据和深度学习模型 解决方案 安装torchvision,参照官网 问题二 安 ...
- 给localhost加一个域名
在C:\Windows\System32\drivers\etc目录下有个文件: hosts 打开后如此加上: localhost name resolution is handled within ...
- Codeforces Round #358 (Div. 2)——C. Alyona and the Tree(树的DFS+逆向思维)
C. Alyona and the Tree time limit per test 1 second memory limit per test 256 megabytes input standa ...
- [BZOJ2118] 墨墨的等式(最短路)
传送门 好神啊.. 需要用非负数个a1,a2,a3...an来凑出B 可以知道,如果一个数x能被凑出来,那么x+a1,x+a2.......x+an也都能被凑出来 那么我们只需要选择a1~an中任意一 ...