div 레이아웃 잡는법 좀 알려주세요 - css 왕초보 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

div 레이아웃 잡는법 좀 알려주세요 - css 왕초보 정보

div 레이아웃 잡는법 좀 알려주세요 - css 왕초보

본문


위 이미지처럼 레이아웃을 한번 잡아보려고 하는데
css 초보라 연습중 ^^

아래 소스 처럼 하는게 맞나요?

<style type="text/css">
#main { margin:0 auto; width:980px; text-align:center; }
#main .header { width:978px; height:120px; border:1px solid #f1f1f1; background-color:#CCCCCC; margin-bottom:10px; }
#main .header2 { width:980px; text-align:center; margin-bottom:10px; height:250px; }
#main .contents { width:980px; text-align:center; margin-bottom:10px; height:400px; }
#main .tail {
 padding:10px;
 border:2px solid #bfbfbf;
 clear:both;
}
</style>

<div id="main">
<!-- 상단헤드 --->
<div class="header"><h2>header</h2></div>

<!-- 상단 컨텐츠 -->
<div class="header2">
<div style="float:left; width:720px; height:250px; margin-right:10px; background-color:#CCCCCC; margin-bottom: 10px;"><h2>content</h2></div>
<div style="float:left; width:250px; height:250px; background-color:#FF9900; margin-bottom: 10px;">
  <h2>right</h2></div>
</div>
<!--- 메인 컨텐츠 --->
<div class="contents">
<div style="float:left; width:720px; height:400px; background-color:#CC9900; margin-right:10px; margin-bottom: 10px;"><h2>content</h2></div>
<div style="float:left; width:250px; height:400px; background-color:#FF66FF; margin-bottom:10px;"><h2>right</h2></div>
</div>

<!--- 푸터 --->
<div class="tail">푸터</div>
</div>

이게 맞나요?

아님 더 간결하게 하는 법 좀

댓글 전체

그걸 참고해서 해보고 있는데 css 코드를 모르니 많이 헤매네요 ㅠㅠ
혹시 코드 설명 잘나와있는 한글 사이트 소개 좀 해주세요
어디에 뭐가 어떻게 쓰이는지는 알아야 하는데~ ㅠㅠ
무식한 방법이지만 http://www.websp.co.kr 에서 공부하는걸로 해봤습니다 ...


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>Untitled Document</title>
<style type="text/css">
#web {
display: block;
width: 800px;
height: 800px;
padding: 10px 10px 10px 10px;
}
#header {
 display: block;
 width: 800px;
 height: 50px;
 }
#left {
 display: block;
 width: 540px;
 height: 300px;
 background-color: #960;
 border: 1px solid #0CC;
 padding: 10px 10px 10px 10px;
 float: left;
 }
#right {
 display: block;
 width: 180px;
 height: 300px;
 background-color: #960;
 border: 1px solid #0CC;
 padding: 10px 10px 10px 10px;
 float: left;
 }
#footer {
 display: block;
 width: 800px;
 height: 60px;
 background-color: #333;
 }
</style>
</head>

<body>
<div id="web">
<div id="header">
<h1>Header</h1>
<div id="left">
CONTENT
</div>
<div id="right">
SIDE
</div>
<div id="left">
CONTENT
</div>
<div id="right">
SIDE
</div>
</div>
<div id="footer">
Footer
</div>
</body>
</html>
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT