Notice
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
관리 메뉴

Jade_o.o

[css] selector 선택자4 - 속성 선택자 본문

CSS

[css] selector 선택자4 - 속성 선택자

by jade 2024. 1. 12. 10:19

css를 통해 selector 선택자 중 속성 선택자에 대해 알아보자

[변수명]{}, [class="클래스명"], [type="password"]

코드를 살펴보며 자세히 알아보자

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>selector 선택자4 - 속성 선택자</title>
    <style>
        [disabled]{
            background-color: pink;
        }

        [placeholder]{
            background-color: yellow;
        }

        [type="password"]{
            font-size: 50px;
        }

        [class="square"]{
            width:50px;
            height: 50px;
            background-color: blue;
            border:1px solid black;
        }
    </style>
</head>
<body>
    <input type="text" placeholder="text1">
    <input type="text" placeholder="text2">
    <input type="text" placeholder="text3" disabled>
    <input type="password">

    <div class="square"></div>
    <div class="square"></div>
    <div class="square"></div>
    <div class="square"></div>
</body>
</html>