[CSS]홈페이지 상단에 공백 없애는 법

박시은·2021년 3월 1일
0

포트폴리오 작업 중에 아래 사진 처럼 홈페이지 상단 부분에 공백이 생겨서 해결해 보았다.

.heading{
            background-color: lightgrey;
            height: 400px;
            
        }

위의 코드가 원래의 코드이다.

.heading{
            background-color: lightgrey;
            height: 400px;
            position: relative;
            top: -30px;
        }

position을 relative로 설정하고 위치를 옮겼더니 해결이 되었다.

profile
프론트엔드 취준생

0개의 댓글