[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.
About 'blockquote':
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; }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2014-12-04 [Express] Level 5: Route Instance -- refactor the code
2014-12-04 [Express] Level 4: Body-parser -- Delete
2014-12-04 [Express] Level 4: Body-parser -- Post
2014-12-04 [Express] Level 3: Massaging User Data
2014-12-04 [Express] Level 3: Reading from the URL
2014-12-04 [Express] Level 2: Middleware -- 2
2014-12-04 [Express] Level 2: Middleware -- 1