작성
·
26
1
@charset "UTF-8";
body{
margin: 0;
background-color: #ffffff;
color: #333333;
}
a{
text-decoration: none;
color: #333333;
}
.container{
width: 100%;
}
.main{
margin: auto;
display: flex;
border: 1px #333333 solid;
box-sizing: border-box;
}
footer{
margin: auto;
}
.left{
width: 200px;
border: 1px #333333 solid;
box-sizing: border-box;
}
.right{
width: calc(100% - 200px);
border: 1px #333333 solid;
box-sizing: border-box;
}
.header-logo{
height: 100px;
border: 1px #333333 solid;
}
.navi{
border: 1px #333333 solid;
box-sizing: border-box;
height: 100px;
}
.sub-menu{
border: 1px #333333 solid;
height: 100px;
}
.header-logo a img{
object-fit: cover;
}
.slide{
height: 400px;
border: 1px #333333 solid;
position: relative;
}
.slide-itmes{
height: 400px;
border: 1px #333333 solid;
position: relative;
overflow: hidden;
}
.silde-items-img{
height: 400px;
width: 300%;
font-size: 0;
position: absolute;
}
.silde-items-img a{
border: 1px #333333 solid;
height: inherit;
width: calc(100% / 3);
display: inline-block;
box-sizing: border-box;
}
.silde-items-img a img{
object-fit: cover;
height: inherit;
width: 100%;
}
.slide-banner{
position: absolute;
top: 0;
right: 0;
box-sizing: border-box;
}
.item1{
height: 200px;
border: 1px #333333 solid;
box-sizing: border-box;
}
.item2{
height: 250px;
border: 1px #333333 solid;
box-sizing: border-box;
}
.news{
height: inherit;
}
footer{
border: 1px #333333 solid;
display: flex;
justify-self: start;
box-sizing: border-box;
width: 100%;
}
footer>div{height: 100px;}
.footer-logo{
background-color: #161111;
width: 200px;
}
.copyright{
background-color: aqua;
width: calc(100% - 400px);
}
.sns{
background-color: rgb(158, 69, 69);
width: 200px;
}
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style.css">
<title>Document</title>
</head>
<body>
<div class="container">
<div class="main">
<div class="left">
<header>
<div class="header-logo">
<a href="#none"><img src="images/logo-b4-header.png" alt=""></a>
</div>
<div class="navi"></div>
<div class="sub-menu"></div>
</header>
</div>
<div class="right">
<div class="slide">
<div class="slide-items">
<div class="slide-items-img">
<a href="#none"><img src="images/slide-d-01.jpg" alt=""></a>
</div>
</div>
<div class="slide-banner">
<a href="#none"><img src="images/banne-a1-02.jpg" alt=""></a>
</div>
</div>
<div class="item1">
<div class="shortcut"></div>
</div>
<div class="item2">
<div class="news"></div>
</div>
</div>
</div>
<footer>
<div class="footer-logo"></div>
<div class="copyright"></div>
<div class="sns"></div>
</footer>
</div>
<script src="script/jquery-1.12.4.js"></script>
<script src="script/custom.js"></script>
</body>
</html>
ovject-fit:cover;했는데 이미지가 유동적으로 변하지 않아서 글을 올립니다 창 넓이를 늘리면 슬라이드창에 맞춰 이미지 크기가 변해 붙지 않고 공백이 생겨납니다
답변 3
0
결국 아래에 클래스네임 오타가 또 있어서 생긴 문제입니다.
하지만 앞으로 계속 학습하실 때 강의와 같은 html 구조와 클래스네임을 사용해주세요. 그렇지 않으시면 오류 찾을 때 제가 처음부터 다시 만들어 봐야 합니다.
그래서 오류 찾기가 힘듭니다. 반드시 강의와 같이 해주세요.
그리고 앞으로 문제가 생겼을 때.. 도저히 모르겠다라고 할 때 일단 클래스네임과 html 구조를 먼저 체크해보세요.
실제 시험에서도 생길 수 있는 일이니 연습하실 때 요령을 길러보세요.
0
이 부분이 좀 어렵고 복잡한 부분입니다. 강의에 있는 html 구조와 클래스네임으로 해주세요.
강의와 다른 html 구조와 클래스네임으로 하시면 오류를 체크하는게 힘들어 집니다.
아래는 강의에 있는 html 구조와 클래스네임입니다. 아래처럼 강의와 같이 하시면 슬라이드 이미지가 유동적으로 사이즈가 조절됩니다.
0
오타 수정했는데 아직 안되어서 답글답니다 ... 도움 부탁드려요