width:1040px 공간안에 폭100%로 박스를 넣는방법?

width:1040px 공간안에 폭100%로 박스를 넣는방법?

QA

width:1040px 공간안에 폭100%로 박스를 넣는방법?

답변 1

본문

메인의 wrapper 폭이 width:1040px 인데, 중간에 폭이 100%인 박스를 넣으려고 합니다.

5da1e9cbeaac40b2fcb4c44a97613fb1_1476597750_6074.png
 

z-index:10000; min-width: 1040px; width:100%; 이런식으로 하면 아무런 변화가없는데요.

어떻게 해줘야 하나요? 

 

이 질문에 댓글 쓰기 :

답변 1

position 을 absolute 로 주시고 left 값을 0 으로 주셔야 합니다.

단 상위태그는 position 값이 없어야 합니다.

 


<html> 
<head> 
<title> </title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<style>
*{padding:0px;margin:0pc}
#wrap{width:1040px;margin:auto;height:1000px;border:2px solid #000}
#wrap .inner{width:100%;position:absolute;height:100px;background:#c3c3c3;left:0px;top:300px;}
</style>
</head> 
<body>
<div id="wrap">
	<div class="inner">
	</div>
</div>
</body>
</html> 
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 20
© SIRSOFT
현재 페이지 제일 처음으로