Community

개발자 99% 커뮤니티에서 수다 떨어요!

← Go back
첫번째 span 왜 display none 이 적용이 안될까요
#html_css
10 months ago
4,334
4
<!DOCTYPE html>
<head>
    <title>Web1</title>
    <style>
        body {
            display: flex;
            height: 100vh;
            align-items: center;
            justify-content: center;
            flex-direction: column;
        }
        div{
            background-color: teal;
            width: 200px;
            height: 200px;
        }
    @media screen and (min-width: 601px) and (max-width: 1200px) and (orientation: landscape) {
        div{
            background-color: wheat;
        }
    }
    span{
        font-size: 36px;
    }
    @media screen and (orientation: landscape) {
        span:first-child {display: none;} 
    }
    @media screen and (orientation: portrait) {
        span:nth-child(2) {display: none;} 
    }
    </style>
</head>
<body>
    <div></div>
    <span>Flip!</span>
    <span>Good!</span>
</body>
</html>

궁금해요!! firstchild로 선택하면 되지않나용?
4 comments