인프런 커뮤니티 질문&답변
전체레이아웃 E형 _ 브라우져 가로스크롤 생성이 됩니다.
작성
·
452
답변 4
0
코딩웍스(Coding Works)
지식공유자
현재 세로 스크롤이 생기는건 CSS 문제가 생겨서 그런건 아닙니다. 다 잘 하셨습니다.
다만, 레이아웃을 잡을 때 아래의 높이를 고정해서 잡아서 높이가 오버되어 보입니다.
하지만 .news와 .gallery에 실제 컨텐츠를 넣으면서 높이를 줄이시면 세로 스크롤이 없이 높이가 가득 차게 됩니다. 그리고 이렇게 한 후 생기는 미세한 세로 스크롤은 보더 때문에 그런 것이고 이거 역시 보더를 나중에 실제 컨텐츠를 넣으면서 없애기 때문에 세로 스크롤이 생기지 않습니다.
.news를 height: 350px 정도로, .gallery를 height: 250px 정도로 하시면 됩니다.

0
윤희숙
질문자
@charset "utf-8";
body {
    margin: 0;
    background-color: #fff;
    color: #333;
}
a{
    text-decoration: none;
    color: inherit;
}
/*entire layout*/
.container{
}
.main-content{
    display: flex;
}
.main-content > div {
    border: 1px solid #000;
}
.left{
    width: 200px;
}
.center{
    width: 400px;
}
.right{
    flex:1;
}
/*header*/
header{}
header > div {
    border: 1px solid red;
}
.header-logo{
    height: 100px;
}
.navi{
    height: 400px;
}
/*items*/
.items{}
.items > div {
    border: 1px solid red;
}
.shortcut{
    height: 130px;
}
.news{
    height: 400px;
}
.gallery{
    height: 300px;
}
.slide-banner{
    height: 100px;
}
/*slide*/
.slide {}
.slide > div {
    border: 1px solid red;
}
.slide-image{
    height: calc(100vh - 100px);
}
/*footer*/
footer{
    display: flex;
}
footer > div {
    border: 1px solid red;
    height: 100px;
}
.footer-logo{
    width: 200px;
}
.footer-content{
    flex: 1;
}
.footer-content > div {
    border: 1px solid red;
    }
.footer-link{
height: 40px;
}
.copyright{}
.family-site{
    width: 300px;
}
0
윤희숙
질문자
<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <title>E4</title>
    <link rel="stylesheet" href="css/style_test.css">
</head>
<body>
    <div class="container">
        <div class="main-content">
            <div class="left">
                <header>
                    <div class="header-logo"></div>
                    <div class="navi"></div>
                </header>
            </div>
            <div class="center">
                <div class="items">
                    <div class="shortcut"></div>
                    <div class="news"></div>
                    <div class="gallery"></div>
                    <div class="slide-banner"></div>
                </div>
            </div>
            <div class="right">
                <div class="slide">
                    <div class="slide-image"></div>
                </div>
            </div>
        </div>
    </div>
    <footer>
        <div class="footer-logo"></div>
        <div class="footer-content">
            <div class="footer-link"></div>
            <div class="copyright"></div>
        </div>
        <div class="family-site"></div>
    </footer>
</body>
</html>0






질문 답글에 올려드렸습니다.