레이아웃이 비뚤합니다.

· 13년 전 · 1632 · 3
간단한 레이아웃입니다.
인크루드로 들어갈 파일인데요.
(아이프레임처럼 만들려고요)

근데, 레이아웃이 정말 안잡히네요.
이렇게 저렇게 태그써봐도 안잡히고
만들어놓으면, 브라우저나 버전따라 다르게 나오니.

어렵습니다.

헤드 스타일 부분이 레이아웃입니다.
아래 이미지 파일이 내용물이고요.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>부산, 자연, 풍경</title>


<style type="text/css">

#align {   
width:100%;   
text-align:center;   

#content { 
margin:0px auto; /*위에서 센터로 놨음에도 또 이걸 해 주는 건 IE외의 다른 브라우저에선 이게 없으면 다시 왼쪽으로 붙기 때문이에요*/  
padding: 35px 0px 0px 0px;
width:705px; 
height:410px;
text-align:left;   
}

#menu1 {
   padding-left: 110px;
}


#menu2 {
   padding-left:: 140px;
        }

#menu3 {
   padding-left: 80px;
        }
#menu4 {
   padding-left:110px;
       }

</style>


</head>





<body>



<div id="aline">
<div id="content">





<span id="menu1">
</span>


<span id="menu2">
</span>


<span id="menu3">
</span>


<span id="menu4">
</span>




</div>
</div>





</body>


</html>



|

댓글 3개

<!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=utf-8" />
<title>부산, 자연, 풍경</title>
<style type="text/css">
#align {width:100%; text-align:center;}
#content {
margin:0px auto;
padding: 35px 0px 0px 0px;
width:400px;
height:410px;
/* text-align:left; */
}
#content span {display:block; float:left; width:170px; padding:0 10px;}
/*
#menu1 {padding-left: 110px;}
#menu2 {padding-left:: 140px;}
#menu3 {padding-left: 80px;}
#menu4 {padding-left:110px;}
*/
</style>
</head>
<body>
<div id="aline">
<div id="content">
<span id="menu1">
<img src="http://badaro09.cafe24.com/img/bumenu1.gif" onMouseOver="this.src='http://badaro09.cafe24.com/img/bumenu11.gif'"
onMouseOut="this.src='http://badaro09.cafe24.com/img/bumenu1.gif'"
onclick="location.href='http://badaro09.cafe24.com/gnuboard4/bbs/board.php?bo_table=badaro09_1'"/>
</span>
<span id="menu2">
<img src="http://badaro09.cafe24.com/img/bumenu2.gif" onMouseOver="this.src='http://badaro09.cafe24.com/img/bumenu21.gif'"
onMouseOut="this.src='http://badaro09.cafe24.com/img/bumenu2.gif'"
onclick="location.href='http://badaro09.cafe24.com/gnuboard4/bbs/board.php?bo_table=badaro09_1'"/>
</span>
<span id="menu3">
<img src="http://badaro09.cafe24.com/img/bumenu3.gif" onMouseOver="this.src='http://badaro09.cafe24.com/img/bumenu31.gif'"
onMouseOut="this.src='http://badaro09.cafe24.com/img/bumenu3.gif'"
onclick="location.href='http://badaro09.cafe24.com/gnuboard4/bbs/board.php?bo_table=badaro09_1'"/>
</span>
<span id="menu4">
<img src="http://badaro09.cafe24.com/img/bumenu4.gif" onMouseOver="this.src='http://badaro09.cafe24.com/img/bumenu41.gif'"
onMouseOut="this.src='http://badaro09.cafe24.com/img/bumenu4.gif'"
onclick="location.href='http://badaro09.cafe24.com/gnuboard4/bbs/board.php?bo_table=badaro09_1'"/>
</span>
</div>
</div>
</body>
</html>

콘텐츠 안에 span값과 이미지 너비값이 다 똑같길래 하나의 span에 속성을 준거고용;;
content의 너비가 705로 되어있는걸 400으로 바꾸고 나머지는 2줄 정렬되도록 안쪽여백값을 양쪽으로 줘서 content영역안에 가운데로 정렬되도록 바꿨습니다.

span은 기본적으로 block속성의 요소가 아니므로 안쪽여백값이 잘 안먹기도 합니다
이럴땐 display:block요소로 block으로 지정시키고 나서 왼쪽정렬로 애들이 옆으로 붙게 만들었어요.
이미지 크기가 170px인거 같고..혹시나 몰라서 170px이라고 span의 너비값을 고정시켰습니다.(고정은 안시켜도 될꺼같네요)

어떤레이아웃을 표현하려고 하시는지는 제대로 모르겠지만 소스 보시고 참고하시면 됩니다.
span의 각각의 ID값은 주석처리해놨습니다;;
그럼 수고하세요;;
님글 도움 많이 되었습니다. span 속성에 대해 잘 몰랐던걸 알게 됐네요.
제가 원하는 모양새는 만들어진거 같은데,
한가지 아쉬운건 익스 6 이하버전에서는 모양이 엉망된다는 건데,
이건 다음에 풀어야 될듯요.
익스6은 생각을 못했네요 ㅋㅋㅋ
당연히 될줄알았습니다 ㅋㅋㅋㅋㅋㅋㅋ
익스6에서 어떤 문제가 발생되는지 알수가없으니 답을 못 드리겠네요;;ㅎㅎ
여튼 공부 열심히 하셔서 멋진 홈페이지 만드시길 바랍니다~
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
13년 전 조회 818
13년 전 조회 1,428
13년 전 조회 912
13년 전 조회 427
13년 전 조회 974
13년 전 조회 4,284
13년 전 조회 580
13년 전 조회 1,073
13년 전 조회 2,715
13년 전 조회 1,291
13년 전 조회 1,665
13년 전 조회 1,301
13년 전 조회 1,959
13년 전 조회 1,367
13년 전 조회 946
13년 전 조회 427
13년 전 조회 1.3만
13년 전 조회 1,205
13년 전 조회 3,345
13년 전 조회 976
13년 전 조회 436
13년 전 조회 607
13년 전 조회 423
13년 전 조회 549
13년 전 조회 4,329
13년 전 조회 6,157
13년 전 조회 870
13년 전 조회 4,667
13년 전 조회 966
13년 전 조회 487
13년 전 조회 658
13년 전 조회 476
13년 전 조회 371
13년 전 조회 612
13년 전 조회 765
13년 전 조회 429
13년 전 조회 501
13년 전 조회 929
13년 전 조회 7,481
13년 전 조회 2,703
13년 전 조회 417
13년 전 조회 1,004
13년 전 조회 925
13년 전 조회 1,058
13년 전 조회 4,920
13년 전 조회 371
13년 전 조회 887
13년 전 조회 2,320
13년 전 조회 1,951
13년 전 조회 1,633
13년 전 조회 1,827
13년 전 조회 2,738
13년 전 조회 388
13년 전 조회 1,861
13년 전 조회 1,269
13년 전 조회 3,062
13년 전 조회 3,110
13년 전 조회 907
13년 전 조회 3,957
13년 전 조회 1,012
13년 전 조회 1,216
13년 전 조회 1,642
13년 전 조회 1,586
13년 전 조회 680
13년 전 조회 849
13년 전 조회 2,765
13년 전 조회 818
13년 전 조회 1,364
13년 전 조회 2,112
13년 전 조회 1,944
13년 전 조회 666
13년 전 조회 1,302
13년 전 조회 3,663
13년 전 조회 922
13년 전 조회 1,376
13년 전 조회 876
13년 전 조회 1,052
13년 전 조회 1,532
13년 전 조회 630
13년 전 조회 1,539
13년 전 조회 1,183
13년 전 조회 744
13년 전 조회 9,140
13년 전 조회 834
13년 전 조회 727
13년 전 조회 799
13년 전 조회 1,529
13년 전 조회 925
13년 전 조회 1,020
13년 전 조회 685
13년 전 조회 537
13년 전 조회 4,622
13년 전 조회 906
13년 전 조회 1,011
13년 전 조회 757
13년 전 조회 6,646
13년 전 조회 823
13년 전 조회 1,149
13년 전 조회 1,117
13년 전 조회 2,831
🐛 버그신고