zoukankan      html  css  js  c++  java
  • css---6伪元素选择器

    after                   :在内容后边

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>after</title>
    <style type="text/css">
    div {
         300px;
        height: 100px;
        border: 1px solid #000;
    }
    div::after {
        content: "我在内容的后面";
    }
    </style>
    </head>
    <body>
    <div>伪元素fgdddddddddddddddddddddddddddddd</div>
    </body>
    </html>
    content after

    before                在内容的前面

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>before</title>
    <style type="text/css">
    div {
         300px;
        height: 100px;
        border: 1px solid #000;
    }
    div::before {
        content: "我在内容的前面";
    }
    </style>
    </head>
    <body>
    <div>伪元素</div>
    </body>
    </html>
    content before

    First-Lette           第一个字母

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>First-Letter</title>
    <style type="text/css">
    div {
         500px;
        margin: 0 auto;
        font-size: 12px;
    }
    div::first-letter {
        color: #f00;
        font-size: 24px;
        font-weight: bold;
    }
    </style>
    </head>
    <body>
        <div>sssss</div>
    </body>
    </html>
    View Code

    First-Line          全部一行

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>First-Line</title>
    <style type="text/css">
    div {
         500px;
        margin: 0 auto;
    }
    div::first-line {
        color: #f00;
        font-weight: bold;
    }
    </style>
    </head>
    <body>
    <div>
        sssss<br>
        sssss<br>
        sssss<br>
    </div>
    </body>
    </html>
    first Line

    ::selection        选择颜色会变

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Selection</title>
    <style type="text/css">
    div::selection {
        background: red;
        color: pink;
    }
    </style>
    </head>
    <body>
    <div>SelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelectionSelection</div>
    </body>
    </html>
    View Code
  • 相关阅读:
    关于二进制补码表示法的一些备忘
    没有''结尾的字符串输出(0)
    关于malloc与字符指针的一些易错点
    centos安装tmux过程
    mac包管理器Homebrew安装命令
    windows下ThinkPHP3.2.3使用memcache缓存
    AJAX请求 $.ajaxSetup方法的使用:设置AJAX请求的默认参数选项,当程序中需要发起多个AJAX请求时,则不用再为每一个请求配置请求的参数
    Name for argument type [java.lang.String] not available
    ag grid
    Javascript 严格模式use strict详解
  • 原文地址:https://www.cnblogs.com/hack-ing/p/11764234.html
Copyright © 2011-2022 走看看