마우스 올리면 나타나기

박서현·2023년 8월 5일
0
post-thumbnail
post-custom-banner
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: lightblue;
            padding: 100px;
        }
        li{
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
        }
        li > input {
            width: 25px;
            height: 25px;

            display: none;
        }
        li:hover > input {
            display: block;
        }

    </style>
</head>
<body>
    <li>
        <input type="checkbox">
        <span>마우스를 올려봐!</span>
    </li>
</body>
</html>

display: none
으로 한 뒤
hover -> display: block

post-custom-banner

0개의 댓글