li 정렬 관련 질문입니다.
늘빈
가로로 100%로 꽉찬 표를 만드는데
총 5개의 칸이 화면을 줄였다 늘여도 같은%로 있어야하는데
제가 li 로 작업을 하면 오른쪽에 여백이 많이 생기고 브라우저를 줄이면 칸이 내려옵니다.
그래서 샘플로 첨부파일처럼 작업하니
아래 소스처럼 빨강부분(li로 작업)은 전체 100%에는 꽉차지 않고
파랑 부분(table로 작업)은 제가 원하는 모양으로 만들어집니다..
둘중에 한가지로 작업을 해야하는데..
문제는 이 부분을 close 했다가 open도 해야해요.
그럼.. 제가 뭘 잘못했는지 도대체 모르겠습니다. ㅠㅠ
간단할것도 같은데.. 왜 전 안되는지.. 완전 바보된 듯..
하코사 고수님들의 도움좀 받고 싶습니다. 제발 도와주세요.ㅠㅠ
첨부파일은
1. 예제로 작업한 파일 : ex-1.html
2. 실제 작업한 파일 일부 :4-13-04-03 -하코사.zip
----------------- 소스 ------------------------------------------------------------------------------------
!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 /
titleUntitled Document/title
style type=text/css
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td,optgroup,option {
margin:0;
padding:0;
}
ol, ul, li {list-style:none;}
#contents-wrap { width:100%;}
#topmenu1 { width:100%; height:121px; margin:0 auto; border:1px solid red; margin-bottom:27px;}
#topmenu1 #menu1 { margin:0 auto; width:100%; border:0px solid red;}
#topmenu1 ul.menu1 { padding:0px;}
#topmenu1 ul.menu1 li { float:left; width:10%; height:121px; margin:0 auto; font-size:15px; color:#red; border:1px solid red;}
#topmenu1 ul.menu1 li.menu-margin1 { text-align:center;}
#topmenu1 ul.menu1 li.margin2 { width:50px;}
#test-wrap { width:100%; min-width:550px; height:120px; margin:0 auto; border:1px solid #09F; }
#test-wrap table.test-1 { width:100%; margin:0 auto; }
#test-wrap table td.test-2 { text-align:center; vertical-align:middle; height:114px; border:1px solid #09F;}
#test-wrap table td.close { text-align:center; vertical-align:top; height:114px; width:50px; border:1px solid #09F;}
/style
body
div id=contents-wrap
div id=topmenu1
ul class=menu1 id=menu1
li class=menu-margin1a href=home.html target=_topcount1br /1,358/a /li
li class=menu-margin1a href=Cattle.html target=_topcount2br /234/a /li
li class=menu-margin1a href=Pen.html target=_topcount3br /897/a /li
li class=menu-margin1a href=Schedule.html target=_topcount4br /721/a /li
li class=menu-margin1 margin2a href=home.html target=_topclose/a /li
/ul
/div
div id=test-wrap
table class=test-1
tr
td class=test-2count1br /1,358/td
td class=test-2count2br /234/td
td class=test-2count3br /897/td
td class=test-2count4br /721/td
td class=closeclose/td
tr
/table
/div
/div
/body
/html
-
남은 2024-09-18
감사합니다. 제가 잘못한 부분 콕 찝어주셨네요.ㅎㅎㅎ
-
큰나라 2024-09-18
#topmenu1 ul.menu1 li 요기 부분에 10%로 되어있네요 근데 li는 5개밖에 없으니 절반이 남을수밖에요
table은 10%로 5개를 줘도 부모의 크기만큼 알아서 늘려주기때문에 저렇게 잘 나오는거구요 ^^
그리고 float:left 줬을땐 margin:0 auto 안주셔도 됩니다 width값이 100% 일때도 마찬가지구요 -
이솔 2024-09-18
앗.. 네.. 감사합니다.^^
-
나나 2024-09-18
테이블에서 tr부분도 안닫혀있네요~ 참고하세요