드

웹표준 코딩 질문 하나만 드릴게요^^

lay1.gif
lay2.gif

DIV를 이용해서 레이아웃을 잡고 있습니다.


테이블 코딩하면 쉽게 해결 가능한것들이 Div 코딩을 시도하다보니 크고 작은 어려움이
생겨나네요. 도와주세요^^*;

 

 

 

 

 

 

당연히 위의 이미지 처럼 배치하고싶으나.. 2번째 이미지처럼 C가 D 밑으로 배치가 되네요

C와 D의 배치를 바꿔도 마찬가지고요;;

어떻게 수정해야하나요?

<xmp>

-스타일시트-

#view_1{width:800px;height:320px;float:left;margin:10px 0 0 0;}
#view_image{width:300px;height:300px;float:left;t;margin:10px 10px 10px 0px; border:1px solid #E4E4E4;padding:10px;}
#view_2{width:450px;height:250px;float:left;margin:20px 0 0 10;}
#detail_view{width:300px;height:55px;float:left ;}
#buy{width:382px;height:20px;float:left;margin:0px 0 0 10;}

</xmp>

 

<xmp>

<div id="view_1"> <!-- 상세페이지 왼쪽 부분 800px-->
 <div id="view_image">A</div>
<div id="view_2"> B</div>
<div id="buy">C</div>
<div id="detail_view">D</div>

 


</div>
</xmp>

 

어떻게 해야 하나요?ㅠ 어렵네요

첨부파일

lay1.gif (2 KB)
0회 2009-08-25 09:17
lay2.gif (2.2 KB)
0회 2009-08-25 09:17

댓글 5개

스타일
#view_1 {width:800px; margin-top:10px;}
#content{float:left; width:45%; margin-right:10px;}
#aside {float:left; width:width:55%;}

div 이렇게
<div id='view_1">
<div id='content'>
<div id='view_image'>A</div>
<div id='buy'>C</div>
</div>
<div id='aside'>
<div id='view_2'>B</div>
<div id='detail_view'>D</div>
</div>
</div>

스타일과 div 를 이렇게 사용해 보세요
보니까 div 속성들이 뒤죽박죽이네요;;; 당연히 안맞습니다..
그리고 DTD는 선언해주셨나요? 웹표준에 따를려면 DTD를 선언해주셔서 작업해주셔야합니다 ^^
우선 좌우를 div로 나누고
그 안에서 다시 아래 위로 나누세요.
float이 어려우시면 차리리 position속성을 이용하세요. 그게 편할지도 모르겠네요.ㅎ
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type="text/css">

div#center {
width:1000px;
}

div#left-top {
width:500px;
height:300px;
float:left;
background:gray;
}


div#right-top {
width:500px;
height:400px;
float:right;
background:black;
}

div#left-bottom {
width:500px;
height:400px;
float:left;
background:red;
}


div#right-bottom {
width:500px;
height:300px;
float:right;
background:blue;
}


</style>
</head>

<body>

<div id="center">
<div id="left-top">

</div>

<div id="right-top">

</div>

<div id="left-bottom">

</div>

<div id="right-bottom">

</div>
</div>

</body>
</html>


이런식으로 해보세요.
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
09-08-25 조회 1,123
09-08-25 조회 1,716
09-08-25 조회 1,162
09-08-25 조회 1,031
09-08-25 조회 1,960
09-08-25 조회 3,116
09-08-25 조회 1,118
09-08-25 조회 1,676
09-08-25 조회 1,233
09-08-24 조회 1,852
09-08-24 조회 1,080
09-08-24 조회 1,460
09-08-24 조회 1,662
09-08-24 조회 2,832
09-08-24 조회 2,149
09-08-24 조회 2,082
09-08-24 조회 1,731
09-08-24 조회 1,672
09-08-24 조회 1,318
09-08-24 조회 1,072