[Distal] pseudo-element selector, after and before pseudo

Pseudo-element selector "::"

For example,

p::first-letter {  选择第一个字
        font-size: 100px;
    }
    p::first-line {  第一行
        color: red;
    }
    p::selection {  /*选择文字时候的状态*/
        background-color: pink;
        color: yellow;

Before and after the use of pseudo-dual floating elements Clear

This is an upgraded version of an empty element, the benefits are not individually labeled a

after can be added after the new content, before adding content in front, but we must add content property, as far as possible content: inside plus a small point or other, try not to be empty, otherwise the firefox versions prior to 7.0 will have. "" Produces a space

Instructions:

.clearfix:before,.clearfix:after { 
  content:"";
  display:table;  /* 这句话可以出发BFC*/
}
.clearfix:after {
 clear:both;
}
.clearfix {
  *zoom:1;
}

Guess you like

Origin www.cnblogs.com/Kighua/p/11570303.html