首页 > Web开发 > 详细

[CSS3] Target HTML Elements not Explicitly set in the DOM with CSS Pseudo Elements

时间:2018-12-05 01:47:06      阅读:204      评论:0      收藏:0      [点我收藏+]

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;
}

 

 

[CSS3] Target HTML Elements not Explicitly set in the DOM with CSS Pseudo Elements

原文:https://www.cnblogs.com/Answer1215/p/10068269.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!