반응형
반응형
반응형

overflow: ######;

          visible : 레이어 크기를 키워서 출력.

          hidden : 레이어 크기만큼 출력.

          auto : 내용에 따라 자동 스크롤.

          scroll : 스크롤바 생성.

     ex) overflow-x:값; overflow-y:값; overflow:값;

 

position: ######;

          static : 기본값.

          relative : 하위에 div가 있을 경우엔 하위의 div를 absolute 배열.

          absolute : div에 top, right, bottom, left 값을 지정해서 원하는 위치에 고정.

          fixed : 스크롤에 상관없이 지정한 위치에 고정.

          inherit : 상위에서 지정한 값을 상속.

 

visibility: ######;

          visible : 보임.

          hidden : 감춤.

 

z-index: #;         :: #값에 따라 우선순위 정의. (값이 높을 수록 위로)

 

left: ##px;

 

top: ##px;

 

width: ###px;

 

height: ###px;

 

text-align: center;

          center , left, right ...

 

background-color: #######;

 

border-style: ######;

          solid , dotted .....

 

border-color: ######;

 

border-width: ##px;

 

border: ###px;

 
 
ex) <div id="layer" style="position:absoulte;top:20px;left:20px;widht:200;height:100px;z-index:1;visibility:hidden;overflow:ato;background:#ffcc00">
</div>

반응형
반응형
[소스]
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 50px; left: 100px; border: dotted">dotted</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 50px; left: 200px; border: dashed">dashed</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 50px; left: 300px; border: solid">solid</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 50px; left: 400px; border: double">double</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 50px; left: 500px; border: groove">groove</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 150px; left: 200px; border: 1 solid">1 solid</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 150px; left: 300px; border: 2 solid">2 solid</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 150px; left: 400px; border: 3 solid">3 solid</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 250px; left: 200px; border: 1 solid red">1 solid red</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 250px; left: 300px; border: 2 solid yellow">2 solid yellow</div>
<div id="Layer0"
 style=" z-index: 1; width: 87px; height: 57px; top: 250px; left: 400px; border: 3 solid blue">3 solid blue</div>


반응형

'프로그래밍 > Html' 카테고리의 다른 글

불여우(FireFox)에서 투명효과 사용하기  (1) 2009.02.11
Div Style  (0) 2009.02.11
table, tr, td 속성  (0) 2009.02.11
table display Example  (0) 2009.02.11
DTD  (0) 2009.02.11
반응형

웹문서 제작에 가장 숙련도를 요구하는 태그로 TABLE 태그가 있다. 웹문서에서 TABLE 태그는 내용물 전체의 배치를 위한 뼈대를 제공하고, 내용물을 직접 나타내기도 하며, 이미지와 더불어 디자인의 중요한 한 요소를 차지하고 있다. 웹문서 제작에 있어 많은 시간을 들이는 부분이기도 하고 문서 내 태그 중에 대부분을 차지하기도 한다. 실제 서비스되는 웹문서에서 모든 내용물은 테이블 속에 담겨져 있다고 가정하면 된다. 표는 줄(row)과 칸(column) 그리고 셀(cell)로 이루어지고, 셀은 줄과 칸이 만나 이루어진 곳으로 표의 내용이 들어가는 곳을 의미한다. 

 

table 태그는 표의 시작과 끝을 정의하고

tr 태그는 표의 행을 정의하며(table row)

td 태그는 행을 이루는 열을 정의한다(table data).

 

따라서 위의 태그들은 홀로 사용될 수 없고 <td>~</td>가 모여 <tr>~</tr> 을 구성하고 <tr> ~ </tr>가 모여 </table>~</table> 을 이루게 된다.

가장 간단한 표라도 다음과 같이 한줄 한칸 짜리 표로 이루어지며 표에 들어갈 내용은 <td> ~</td> 사이에만 들어갈 수 있다.

<table>          
  <tr>       한줄
    <td>   한칸
      표 속에 들어갈 내용은 여기!!!
    </td>  
  </tr>      
</table>          

 

 

TABLE Element

align

left | center | right   테이블 전체의 수평 정렬 Default : left

)

<table align="center">

background

uri   테이블 전체의 배경 그림

)

<table background="../images/bg_hor_line.gif">

bgcolor

테이블의 배경색

)

<table bgcolor="silver"> , <table bgcolor="#EEEECC">

border

절대 단위,    테이블의 border(테두리) 두께

)

<table border="3">

height

테이블의 높이

)

<table height="100%">

width

절대단위 | 상대단위   테이블 전체의 가로 크기

)

<table width="600"> , <table width="90%">

nowrap

테이블 전체 셀의 text의 줄바꿈 방지

)

<table nowrap> , <tr nowrap="nowrap">

cellpadding

절대단위   테이블 Cell border Cell 속의 내용물과의 거리, 기본값 1

)

<table cellpadding="5">

cellspacing

절대단위   테이블 Cell 간의 거리와 Cell과 테이블 border와의 거리, 기본값 2

)

<table cellspacing="5">

bordercolor

테이블 Cell의 테두리 색

)

<table bordercolor="lightgreen">

bordercolordark

테이블 우측과 하단의 border

)

<table bordercolordark="red" bordercolorlight="blue">

bordercolorlight

테이블 좌측과 상단의 border

)

<table bordercolordark="red" bordercolorlight="blue">




TR(Table Row) Element

align

테이블 행의 Cell 또는 Cell 들 속의 내용물의 수평 정렬

)

<tr align="center">

valign

테이블 행의 Cell 또는 Cell 들 속의 내용물의 수직 정렬

)

<tr valign="baseline">

bgcolor

테이블 행의 Cell 또는 Cell 들 속의 내용물의 배경색

)

<tr bgcolor="silver"> , <tr bgcolor="#EEEECC">

height

행의 높이

)

<tr height="25">

width

행의 너비

)

<tr height="25" width="150">

nowrap

행속의 셀의 text의 줄바꿈 방지

)

<tr nowrap> , <tr nowrap="nowrap">

bordercolor

행속 Cell 좌우상하의 border

)

<tr bordercolor="red">

bordercolordark

행속 Cell 우측과 하단의 border

)

<tr bordercolordark="red" bordercolorlight="blue">

bordercolorlight

행속 Cell 좌측과 상단의 border

)

<tr bordercolordark="red" bordercolorlight="blue">



TD(Table Data) Element

align

Cell 속의 내용물의 수평 정렬

)

<td align="center">

valign

Cell 속의 내용물의 수직 정렬

)

<td valign="baseline">

background

uri   테이블 Cell의 배경 그림

)

<table background="../images/bg_hor_line.gif">

bgcolor

Cell 속의 내용물의 배경색

)

<td bgcolor="silver"> , <td bgcolor="#EEEECC">

height

Cell의 높이

)

<td height="25">

width

Cell의 너비

)

<td height="25" width="150">

nowrap

Cell 속의 text의 줄바꿈 방지

)

<td nowrap> , <td nowrap="nowrap">

colspan

수평으로 병합할 column()의 개수(span)

)

<td colspan="3">

rowspan

수직으로 병합할 row()의 개수(span)

)

<td rowspan="2">

 

 

테이블 여백 조절하기

 

cellpadding : 테두리 선과 내용 사이의 여백 조절

cellspacing : 셀과 셀 사이의 여백 조절

 

cellpadding=0 / cellspacing=0

 

cellpadding=20 / cellspacing=10

 

cellpadding=0 / cellspacing=30

 

반응형

'프로그래밍 > Html' 카테고리의 다른 글

Div Style  (0) 2009.02.11
<DIV> 태그 border 셋팅  (0) 2009.02.11
table display Example  (0) 2009.02.11
DTD  (0) 2009.02.11
Div 와 Span  (0) 2009.02.11
반응형

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>Hiding Information in Rows and Cells Sample</title>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
<meta name="AUTHOR" content="InetSDK">
<meta name="MS.LOCALE" content="EN-US">
<meta name="ROBOTS" content="noindex">
<link rel="stylesheet" href="samplesSDKIE4.css" type="text/css">
<style type="text/css">
td {
 border: 1px solid;
}
</style>
<script type="text/javascript">
function getPets() {
 tblChoice1.style.display="none";
 tblChoice2.style.display="";
 tblChoice3.style.display="none";
 }
function getOthers() {
 tblChoice1.style.display="";
 tblChoice2.style.display="none";
 tblChoice3.style.display="";
 }
function getFast() {
 tblChoice1_1.style.visibility="visible";
 tblChoice2_1.style.visibility="visible";
 tblChoice3_1.style.visibility="hidden";
 }
function getSlow() {
 tblChoice1_1.style.visibility="hidden";
 tblChoice2_1.style.visibility="hidden";
 tblChoice3_1.style.visibility="visible";
 }
function showallRows() {
 tblChoice1.style.display="";
 tblChoice2.style.display="";
 tblChoice3.style.display="";
 }
function showallCells() {
 tblChoice1_1.style.visibility="visible";
 tblChoice2_1.style.visibility="visible";
 tblChoice3_1.style.visibility="visible";
 }

</script>
</head>

<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<body>

<div class="body">
 <h1>Hiding Information in Rows and Cells Sample</h1>
 <p>This example shows use of the <b>display</b> property applied to table rows
 and the <b>visibility</b> property applied to table cells. Each button calls
 a function that sets the display properties depending on the user&#39;s selection.</p>
 <p>Displaying cells within a row is dependent on the row being displayed. Accordingly,
 displaying a cell with an animal&#39;s speed will show only if the corresponding
 row is also displayed. </p>
 <p>Note that an embedded style sheet sets the <b>td</b> element&#39;s style to {border:
 1px solid}. </p>
 <center>
 <table>
  <tr id="tblChoice1">
   <td>Horses</td>
   <td id="tblChoice1_1">Thoroughbreds</td>
   <td>Fast</td>
  </tr>
  <tr id="tblChoice2">
   <td>Dogs</td>
   <td id="tblChoice2_1">Greyhounds</td>
   <td>Fast</td>
  </tr>
  <tr id="tblChoice3">
   <td>Marsupials</td>
   <td id="tblChoice3_1">Oppossums</td>
   <td>Slow</td>
  </tr>
 </table>
 <p>
 <input type="button" style="width: 150px" ="getPets()" value="Show household pets">
 <input type="button" style="width: 150px" ="getOthers()" value="Show outdoor pets">
 </p>
 <p>
 <input type="button" style="width: 150px" ="getFast()" value="Show fast animals">
 <input type="button" style="width: 150px" ="getSlow()" value="Show slow animals">
 </p>
 <p>
 <input type="button" ="showallCells();showallRows()" value="Refresh">
 </p>
 </center>
 <!-- START_PAGE_FOOTER --><br>
 <br>
 <br>
 <p class="viewsource">[Right-click and choose View Source from the shortcut
 menu.] </p>
 <a class="copyright" href="http://www.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm">
 ?2007 Microsoft Corporation. All rights reserved. Terms of use.</a>
 <!-- END_PAGE_FOOTER --></div>

</body>

</html>


반응형

'프로그래밍 > Html' 카테고리의 다른 글

<DIV> 태그 border 셋팅  (0) 2009.02.11
table, tr, td 속성  (0) 2009.02.11
DTD  (0) 2009.02.11
Div 와 Span  (0) 2009.02.11
색상표코드 알아보는 프로그램  (0) 2009.02.11
반응형

Archive / Markup / DocumentTypeDefinition

HTML이나 XHTML과 같은 마크업 문서는 문서가 시작할 때 문서형 선언(Document Type Definition)을 명시하여 문서에 사용되는 마크업을 파서(parser)가 파악할 수 있게 해야 한다. 문법 검사기(validator)도 이 DTD를 기준으로 마크업에 사용된 태그나 속성이 정확한지를 검사한다. 모든 마크업 문서는 이 DTD를 명시해 주어야만 한다.

DTD의 종류

웹에서 사용하는 마크업 언어는 HTML 4.01과 XHTML 1.0, XHTML 1.1이 있다. 각 마크어 언어는 특징에 따라서 트랜지셔널(Transitional), 스트릭트(Strict), 프레임셋(Frameset)으로 세분화 된다. 트랜지셔널은 디자인적인 속성이 포함된 DTD이고 스트릭트는 디자인 적인 속성이 모두 제거된 형식이다. <a>에 타겟(target)속성을 이용하거나 <td>에 너비(width), 높이(height) 등의 속성을 사용하기 위해서는 트랜지셔널 DTD를 사용해야 한다. 프레임셋은 트랜지셔널 DTD에 프레임을 사용할 수 있게 프레임 관련된 선언을 포함한 DTD이다.

HTML 4.01 Strict DTD
<!DOCTYPE 
HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional DTD
<!DOCTYPE 
HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset DTD
<!DOCTYPE 
HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" 
"http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0 Strict DTD
<!DOCTYPE 
html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.0 Transitional DTD
<!DOCTYPE 
html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Frameset DTD
<!DOCTYPE 
html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1 DTD
<!DOCTYPE 
html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

DTD의 선택

문서의 DTD를 선택할 때에 사용되는 절대적인 기준이 있는 것은 아니고 저작자의 판단에 전적으로 의존하게 된다. 문서의 저작 환경을 고려하고 향후 관리를 하는데 용이하도록 DTD를 정하면 된다. 보통 제작 이후에 어떠한 사람들이 사이트를 유지, 관리하고 표준의 준수에 대한 의지가 어느정도인가에 따라서 DTD를 결정하게 된다. 예를 들어서 유지, 관리 하는 인원이 타겟 속성을 사용한다든가 높이, 너비를 마크업 언어에 직접 명시하고자 한다든가, 모든 인원들이 웹표준을 완전히 익히기가 힘든 상황이라면 XHTML DTD를 선택하기 보다는 HTML DTD를 선언하여 사용하는 것이 바람직하다.

HTML 4.01 트랜지셔널(Transitaional)이라고 해서 XHTML 1.1보다 못하거나 수준이 낮은, 또는 웹표준이 아닌 것은 아니다. 상황에 맞는 DTD를 선택하고 선택한 DTD를 완벽하게 준수하는 것이 중요하다.

처음 접근하기 쉬운 DTD

웹표준을 처음 접할 때에는 XHTML을 선택 하는 것 보다는 HTML 4.01 트랜지셔널을 선택하고 문법을 완전히 지킬 수 있게 노력하는 것이 더 좋은 선택이다. 문법검사기를 완전히 통과하지 않는 문서는 CSS를 적용하여 제작했다고 해도 완벽하다고 할 수가 없다.

마임타입(mime-type)과 DTD

XHTML의 경우 문서의 마임타입이 application/xhtml+xml로 제공이 되어야 한다. XHTML 1.0에서는 하위 호환성을 위해서 text/html로 전송하는 것도 허용하고는 있지만 XHTML1.1은 반드시 application/xhtml+xml로 배포 되어야 한다. 이러한 의미에서 본다면 XHTML보다는 HTML 4.01 Strict가 더 좋은 선택이 될 수도 있다.

DTD와 랜더링 모드

이론적으로 DTD와 랜더링은 전혀 무관하지만 요즘의 브라우저들은 DTD에 따라서 랜더링을 다르게 한다. 표준 방식으로 랜더링을 할 경우, 기존의 비표준 방식의 랜더링에서 잘 나오던 웹페이지가 잘못 랜더링 될 수가 있기 때문에 표준 방식으로 랜더링 할지, 비표준 방식으로 랜더링 할지를 이 DTD선언을 참조하여 결정하게 된다.

표준방식 랜더링과 비표준방식 랜더링이 가장 차이가 많이나는 브라우저는 인터넷 익스플로러이다. 인터넷 익스플로러는 레이아웃 제작이나 위치를 설정하는데 영향을 크게 미치는 박스모델이 랜더링 모드에 따라서 차이가 크다. CSS에서 말하는 박스모델에서는 너비(width)는 콘텐츠가 들어가는 영역의 너비를 의미하는데 인터넷 익스플로러의 비표준 방식 랜더링에서는 너비를 콘텐츠의 너비 + 안쪽 여백(padding) + 경계선(border)으로 정의하고 있다. 그래서 어느 DTD를 선택하는지에 따라서 안쪽 여백이나 경계선을 사용한 부분의 디자인이 많이 달라지게 된다.

인터넷 익스플로러에서 랜더링 엔진을 변경하는 기준은 MSDN(CSS Enhancements in Internet Explorer 6)에 잘 나와있다. HTML 4.0 트랜지셔널과 프레임셋의 경우 DTD URL이 있는지 없는지에 따라서 랜더링 모드가 바뀌게 되기 때문에 주의해야 한다.

인터넷 익스플로러의 경우 랜더링 모드에 따라서 캔버스영역이 바뀌기 때문에 주의해야 한다. 비표준방식에서는 캔버스를 이루는 요소가 <body>이지만 표준방식에서는 <html> 요소가 캔버스가 된다. 그래서 스크롤바의 디자인 적용도 <body>가 아닌 <html>로 해야하고 캔버스영역의 값들도 document.body가 아닌 document.documentElement에서 참조 하여야 한다. 스크립트에 대한 자세한 사항은 QuriksMode의 document.body and doctype switching에 상세하게 나와있다.

관련링크
DTD (Document Type Definition) by 1upz

반응형

'프로그래밍 > Html' 카테고리의 다른 글

table, tr, td 속성  (0) 2009.02.11
table display Example  (0) 2009.02.11
Div 와 Span  (0) 2009.02.11
색상표코드 알아보는 프로그램  (0) 2009.02.11
css !important  (0) 2009.02.11

+ Recent posts