css 伪元素 伪类 使用 万能清除浮动 ..

参考 http://blog.jobbole.com/49173/

css 伪元素即插入的虚伪元素 像:before :after 插入元素
css 伪类 就是 操作class 样式
利用伪元素清除浮动

ps 利用伪 元素插入的dom 在dom结构中是看不到的 不过可以在css 中看到

       .clearfix::after {
            content: ".";
            clear: both;
            display: block;
            overflow: hidden;
            font-size: 0;
            height: 0;
        }



.clearfix {
            zoom: 1;
        }

利用伪元素插入 图片

blockquote:before {
 content: " ";
 font-size: 24pt;
 text-align: center;
 line-height: 42px;
 color: #fff;
 float: left;
 position: relative;
 top: 30px;
 border-radius: 25px;

 background: url(images/quotationmark.png) -3px -3px #ddd;

 display: block;
 height: 25px;
 width: 25px;
}
blockquote:after {
 content: " ";
 font-size: 24pt;
 text-align: center;
 line-height: 42px;
 color: #fff;
 float: right;
 position: relative;
 bottom: 40px;
 border-radius: 25px;

 background: url(images/quotationmark.png) -1px -32px #ddd;

 display: block;
 height: 25px;
 width: 25px;
}
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值