before和after

before和after分别是向选择器之前之后插入内容,必须配合content属性使用,
我们使用before和after去设置一些样式就是content里的内容样式
<title>before和after</title>
div::before{
      content: '你好';
      color: red;
}
      div::after{
      content: "我是帅哥";
      color: blue;
      position: absolute;
      width: 100px;
      height: 100px;
     
}
</style>
posted @ 2017-02-15 13:27  AdiaLike  阅读(129)  评论(0编辑  收藏  举报