僞類 統一添加樣式

僞類:   統一添加樣式    很好的減小了代碼量html

 

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<style>
    h3{
        display: inline-block;
        position: relative;/* 父級給相對定位 */
    }
    h3:before {
    content: '';/* 必需 */
    position: absolute;/* 必需 */
    width: 10px;/* 必需 */
    height: 10px;/* 必需 */
    background: pink;
    border-radius: 50px;
    left: -20px;
    top: 10px;
}
</style>
    <div align="center">
        <h3>僞類</h3>
    </div>
</body>
</html>
相關文章
相關標籤/搜索