W3School-CSS 伪元素 (Pseudo-elements) 实例

CSS 伪元素 (Pseudo-elements)实例

CSS 实例

  • CSS 背景实例
  • CSS 文本实例
  • CSS 字体(font)实例
  • CSS 边框(border)实例
  • CSS 外边距 (margin) 实例
  • CSS 内边距 (padding) 实例
  • CSS 列表实例
  • CSS 表格实例
  • 轮廓(Outline)实例
  • CSS 尺寸 (Dimension) 实例
  • CSS 分类 (Classification) 实例
  • CSS 定位 (Positioning) 实例
  • CSS 伪类 (Pseudo-classes)实例
  • CSS 伪元素 (Pseudo-elements)实例

01制作首字母特效
<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8">
        <title>01制作首字母特效</title>
        <style type="text/css">
            p:first-letter {
                color: #ff0000;
                font-size: xx-large;
            }
        </style>
    </head>

    <body>
        <p>
            You can use the :first-letter pseudo-element to add a special effect to the first letter of a text!
        </p>
    </body>

</html>

846157-20160123155457953-995456176.png


02制作首行特效
<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8">
        <title>02制作首行特效</title>
        <style type="text/css">
            p:first-line {
                color: #ff0000;
                font-variant: small-caps;
            }
        </style>
    </head>

    <body>
        <p>
            You can use the :first-line pseudo-element to add a special effect to the first line of a text!
        </p>
    </body>

</html>

846157-20160123160051140-864053614.png


CSS 伪元素 (Pseudo-elements) 总结

846157-20160123160301718-958188768.png

转载于:https://www.cnblogs.com/hoey/p/5153409.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值