답변 1개 / 댓글 2개
채택된 답변
+20 포인트
// CSS에 변경
#website {
height: 100px;
position: relative;
background: #666;
width: 50%;
left: -100%;
float:left; /* 추가*/
}
---------------
//JavaScript에 추가
$(function() {
$("#website2").click(function() {
$("#website2").hide();
});
});
답변에 대한 댓글 2개
@머시기거시기
이걸 조금더 안정적으로 처리하시려면
website 바깥에 div을 하나 씌워서
height를 적절하게 주시면 더 좋습니다.
<div id="web">
<a class="show" style="color:#999;">클릭 div 슬라이딩</a>
<div id="website">
Your DIV here!
</div>
<div id="website2" style="margin:0 auto">
my DIV here!
</div>
</div>
<div style="width:855px;height:20px;background:orange">
tail
</div>
#web {
height:120px;
}
이걸 조금더 안정적으로 처리하시려면
website 바깥에 div을 하나 씌워서
height를 적절하게 주시면 더 좋습니다.
<div id="web">
<a class="show" style="color:#999;">클릭 div 슬라이딩</a>
<div id="website">
Your DIV here!
</div>
<div id="website2" style="margin:0 auto">
my DIV here!
</div>
</div>
<div style="width:855px;height:20px;background:orange">
tail
</div>
#web {
height:120px;
}
답변을 작성하려면 로그인이 필요합니다.
역시 대단합니다.
https://jsfiddle.net/cdgha5on/1/
ㅎㅎ