[Day4] HTML 4 [11/7]
--๋ณต์ต--
<style>
p{
background-image: url(''๊ฒฝ๋กURL);
width: px;
height: cm;
border:1px solid gary;
font-size: ;
padding:
margin:0 auto;
}
</style>
- ๊ฒฐ๊ณผ ์ด๋ฏธ์ง๋ฅผ ๋ณด๊ณ <style> ํ๊ทธ๋ฅผ ์์ฑํ์ธ์.
<style>
table{
width:100%;
border:1px solid #ddd;
border-collapse: collapse;
}
th, td{
border:1px solid #ddd;
padding: 8px;
text-align: left;
}
tr:nth-child(even){
background-color: #ddd;
}
</style>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr>
<td>Ernst Handel</td>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
<tr>
<td>Island Trading</td>
<td>Helen Bennett</td>
<td>UK</td>
</tr>
<tr>
<td>Laughing Bacchus Winecellars</td>
<td>Yoshi Tannamuri</td>
<td>Canada</td>
</tr>
<tr>
<td>Magazzini Alimentari Riuniti</td>
<td>Giovanni Rovelli</td>
<td>Italy</td>
</tr>
</table>
<style>
table{
width: 100%;
}
th, td{
border:1px solid #96D4D4;
border-radius: 10px;
}
</style>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
<table>
<tr>
<th colspan="3">2022๋
</th>
</tr>
<tr>
<td> </td>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td></td>
<td></td>
</tr>
<tr>
<!-- align="center" valign="middle" -->
<td style="text-align: center;" rowspan="2" colspan="2">์ถ์ </td>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td></td>
<td></td>
</tr>
</table>
<style>
table{
board:1px solid black;
border-collapse: collapse;
width:100%;
}
th, td{
border:1px solid black;
}
tr:nth-child(even), th:nth-child(even), td:nth-child(even){
/* background-color: rgb(150, 212,212); + ์ํ(a)==ํฌ๋ช
๋ 0~1*/
background-color: rgba(150, 212,212,0.4);
}
/*
th:nth-child(even), td:nth-child(even){
background-color: rgba(150, 212,212,0.4);
}
*/
</style>
<table>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
<th>FRI</th>
<th>SAT</th>
<th>SUN</th>
</tr>
<!-- tr*5>td*7>{ } -->
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<style>
table{
width: 100%;
border-collapse: collapse;
}
th, td{
/* border:1px solid #ddd; */
border-bottom: 1px solid #ddd;
}
/* css ์ ํ์(selector) :not() */
tr:hover:not(tr:first-child){
background-color: #d6eeee;
}
</style>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
<td>$100</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
<td>$150</td>
</tr>
<tr>
<td>Joe</td>
<td>Swanson</td>
<td>$300</td>
</tr>
<tr>
<td>Cleveland</td>
<td>Brown</td>
<td>$250</td>
</tr>
</table>
- ํ ์ด๋ธ์ ๋๋น๋ฅผ 100%๋ก ์ค์ ํ๊ณ , ์ฒซ ๋ฒ์งธ ์ด์ ๋๋น๋ฅผ ํ ์ด๋ธ์ 70%๋ก ์ค์ ํ๊ณ , ๋ ๋ฒ์งธ ํ์ ๋์ด๋ฅผ 100px๋ก ์ค์ ํ๋ ์ฝ๋ฉ์ ํ์ธ์.
<table>
<tr>
<th style="width: 70%">Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr style="height: 100px">
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
- ์์ ํ ์ด๋ธ(13)์ ์ฒซ ๋ฒ์งธ, ๋ ๋ฒ์งธ ์ด์ ์คํ์ผ(๋ฐฐ๊ฒฝ์ ๋นจ๊ฐ)์ ์ง์ ๋ ์ฝ๋ฉ์ ํ์ธ์.
<table>
<!--
caption: ์บก์
, (์ฌ์ง์ฝํ ๋ฑ์ ๋ถ์ธ ์ค๋ช
)
ํ
์ด๋ธ ๋ถ์ธ ์ค๋ช
-->
<caption>ํ
์ด๋ธ ์ค๋ช
</caption>
<!-- ํ์ด ์๋๋ผ ์ด์ ์คํ์ผ ์ง์ ํ๊ณ ์ํ๋ค๋ฉด -->
<!-- ์ฃผ์ํ ์ : ์ ํ์ ์ด๋ค.( backgroud, width, border, visibility ์์ฑ) -->
<!-- visibility: collapse์์ฑ ์ ์ฌ์ฉํ์ฌ ์ด์ ์จ๊ธธ ์ ์์ต๋๋ค . -->
<colgroup>
<col span="2" style="background-color: red">
<col style="background-color: blue">
</colgroup>
<tr>
<th style="background-color: red">First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td style="background-color: red">Peter</td>
<td style="background-color: red">Griffin</td>
<td>$100</td>
</tr>
<tr>
<td style="background-color: red">Lois</td>
<td style="background-color: red">Griffin</td>
<td>$150</td>
</tr>
<tr>
<td style="background-color: red">Joe</td>
<td style="background-color: red">Swanson</td>
<td>$300</td>
</tr>
<tr>
<td style="background-color: red">Cleveland</td>
<td style="background-color: red">Brown</td>
<td>$250</td>
</tr>
</table>
- caption : ํ ์ด๋ธ ์ค๋ช
- colgroup : ํ ์ด๋ธ์ ์นผ๋ผ(์ด) ๊ทธ๋ฃน
col : ์นผ๋ผ(์ด)๋จ์ ๊ด๋ฆฌ
- ํ ์ด๋ธ ํจ๋ฉ ๋ฐ ๊ฐ๊ฒฉ
<body>
<!-- table>tr*3>td*3>{ํ๊ธธ๋} -->
<table border="1" bordercolor="red" cellpadding="10px" cellspacing="10px">
<!-- cellpadding="10px" ์์ฑ : ์
์ ๊ฐ์ฅ์๋ฆฌ์ ์
๋ด์ฉ ์ฌ์ด์ ๊ณต๊ฐ -->
<!-- cellspacing="10px" ์์ฑ : ์
๊ณผ ์
์ฌ์ด์ ๊ฐ๊ฒฉ -->
<tr>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
</tr>
<tr>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
</tr>
<tr>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
</tr>
</table>
</body>
-----
<style>
table, th, td{
/* border="1" bordercolor="red" */
border:1px solid red;
}
/* cellpadding="10px" */
th, td{
padding: 10px;
}
/* cellspacing="10px" */
table{
border-spacing: 10px;
}
</style>
<table>
<tr>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
</tr>
<tr>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
</tr>
<tr>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
<td>ํ๊ธธ๋</td>
</tr>
</table>
ํ ์ด๋ธ ์์)
<table style="width:100%;border:1px solid red">
<tr style="height:150px;">
<td>
<h1>TOP</h1>
</td>
</tr>
<tr>
<td>
<table style="width:100%">
<tr>
<td style="width:150px"></td>
<td align="left">
<a href="#"><img style="width:22px;height:22px" alt="" src="http://ojsimg.ohmynews.com/images/ohmynews/common/tts.svg">๋ณธ๋ฌธ๋ฃ๊ธฐ</a>
</td>
<td align="right">
52 12
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<table style="width:100%;border:1px solid red">
<tr style="height:150px;">
<td colspan="3">
<h1>TOP</h1>
</td>
</tr>
<tr>
<td style="width:150px"></td>
<td align="left">
<a href="#"><img style="width:22px;height:22px" alt="" src="http://ojsimg.ohmynews.com/images/ohmynews/common/tts.svg">๋ณธ๋ฌธ๋ฃ๊ธฐ</a>
</td>
<td align="right">
52 12
</td>
</tr>
</table>
-> table ์์ฐ๊ณ position ํ๊ทธ๋ก div ์์น ๋ฐ๋ก ๋ฐ๊ฟ ์ ์์ !
์ด๋ ๊ฒ ํ๋๊ฒ ๋ ์ข์, table์ ์ ์ง๋ณด์๊ฐ ํ๋ค์ด!
- ๋ชจ๋ td align="center"
- ํ
์ด๋ธ์ ๋๋น๋ ์ค์ O, ์
์ ๋๋น๋ฅผ ์ค์ X
- ํ
์ด๋ธ์ ๋์ด๋ ๋ด์ฉ์ด ์์ ๋๋ 200px ์ ์งํ์ง๋ง ๋ด์ฉ์ด ๋ง์ ๋๋ ๋์ด๋ ์๋ฏธ๊ฐ ์์ด์ง๋ค.
- ํ
์ด๋ธ์ ๋๋น,๋์ด, ์
์ ๋๋น, ๋์ด๋ฅผ ์ค์ ํ๋๋ผ๋ ์ํ๋ฒณ, ์ซ์ ์ธ ๊ฒฝ์ฐ์๋ ๊นจ์ง๋๋ผ.
- ๋ฌธ์ ์ ํด๊ฒฐ -> css ์์
.
<style>
table{
width:200px;
height:200px;
text-align: center;
}
table, th, td{
border:1px solid gray;
}
</style>
<!-- table>tr*2>td*2>{$} -->
<table>
<tr>
<td style="width: 50%;height:50%">ใฑใดใทใน ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใฑใดใทใน ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
</td>
<!-- <td style="width: 50%;height:50%">123456789012345678901234567890123456789012345678901234567890</td> -->
<td style="width: 50%;height:50%">1234</td>
</tr>
<tr>
<td style="width: 50%;height:50%">ใฑใดใทใน ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใฑใดใทใน ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
</td>
<td style="width: 50%;height:50%">abcdefghijklmnopqrstuvwxyz</td>
</tr>
</table>
<hr>
<table>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
html - ๋ชฉ๋ก(list)
์น ๊ฐ๋ฐ์๊ฐ ๋ชฉ๋ก์ ๊ด๋ จ๋ ํญ๋ชฉ ์งํฉ์ ๊ทธ๋ฃนํํ ์ ์๋ ํ๊ทธ - ๋ชฉ๋กํ๊ทธ
- ์์ ์๋ ๋ชฉ๋ก( ordered list== ol ํ๊ทธ)
- ์์ ์๋ ๋ชฉ๋ก(unordered list == ul ํ๊ทธ)
- li == list item == ๋ชฉ๋ก ์์ดํ (ํญ๋ชฉ)
<ol type="i">
<li>๊น๊ฐ์จ</li>
<li>์กฐ๋ฏผ๊ฒฝ</li>
<li>์ํฌ์ง</li>
<li>์ด์ฌ๋ฏผ</li>
<li>์ํํ</li>
<li>ํฉ์๋น</li>
<li>๋ฐํ์</li>
</ol>
<!-- ul type ์์ฑ = disk(๊ธฐ๋ณธ๊ฐ) , circle, square -->
<ul type="square">
<li>๊น๊ฐ์จ</li>
<li>์กฐ๋ฏผ๊ฒฝ</li>
<li>์ํฌ์ง</li>
<li>์ด์ฌ๋ฏผ</li>
<li>์ํํ</li>
<li>ํฉ์๋น</li>
<li>๋ฐํ์</li>
</ul>
- ์ค์ฒฉ ๋ชฉ๋ก
<!-- ol>li*5>{item-$} -->
<ol start="21">
<li>item-1</li>
<li>item-2</li>
<li type="A">item-3</li>
<li>item-4</li>
<li>item-5</li>
</ol>
- li ํ๊ทธ ์์ ์๋ก์ด ๋ชฉ๋ก ๋๋ ์ด๋ฏธ์ง ๋๋ ๋งํฌ ํ๊ทธ๊ฐ ํฌํจ๋ ์ ์๋ค.
<!-- ol>li*3>{$์กฐ} -->
<ul>
<li>1์กฐ
<ol type="i">
<li><a href="#">1์กฐ ํ ์น ์ฌ์ดํธ</a></li>
<li>๊น๊ฐ์จ
<ol>
<li>ํ์ฅ</li>
<li>์ค๋ผํด</li>
</ol>
</li>
<li>์กฐ๋ฏผ๊ฒฝ</li>
<li>์ํฌ์ง</li>
<li>์ด์ฌ๋ฏผ</li>
<li>์ํํ</li>
<li>ํฉ์๋น</li>
<li>๋ฐํ์</li>
</ol>
</li>
<li>2์กฐ
<ol type="i">
<li>๊น๊ฐ์จ</li>
<li>์กฐ๋ฏผ๊ฒฝ</li>
<li>์ํฌ์ง</li>
<li>์ด์ฌ๋ฏผ</li>
<li>์ํํ</li>
<li>ํฉ์๋น</li>
<li>๋ฐํ์</li>
</ol>
</li>
<li>3์กฐ
<ol type="i">
<li>๊น๊ฐ์จ</li>
<li>์กฐ๋ฏผ๊ฒฝ</li>
<li>์ํฌ์ง</li>
<li>์ด์ฌ๋ฏผ</li>
<li>์ํํ</li>
<li>ํฉ์๋น</li>
<li>๋ฐํ์</li>
</ol>
</li>
</ul>
ex05.html - Navigation(ํญํด) Menu ( ๋ณต์ต๋ฌธ์ )
<style>
body{
/* border:1px solid red; */
padding: 0;
margin: 0;
}
ul, li{
/* border:1px solid gray; */
/* ๋ธ๋ญ๋ชจ๋ */
}
ul{
/* list-style-type: decimal; */
list-style-type: none;
padding: 0;
margin: 0;
/* border: 2px solid red; */
background-color: #333;
overflow: hidden; /* ์ด๋ฐ ์ํฉ์ ์ด ์์ฑ ()์๊ธฐ) */
}
li{
/* margin: 0; */
float: left;
}
/* ๋ธ๋ญ๋ชจ๋, ์ธ๋ผ์ธ๋ชจ๋ */
/* a ํ๊ทธ : ์ธ๋ผ์ธ๋ชจ๋์ด๊ธฐ ๋๋ฌธ์ width ์์ฑ ์ค์ X -> ๋ธ๋ญ๋ชจ๋ ๋ณ๊ฒฝ */
ul li a{
color: white;
/* background-color: red; */
/* width:300px; */
display: block;
text-align: center;
text-decoration: none;
padding: 16px;
}
ul li a:hover{
background-color: #111;
color:orange;
}
ul li:nth-child(1){
background-color: red;
}
</style>
<body>
<!-- ul>li*4>a[href='#'] -->
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</body>
- float : ๋ฉ๋ด ์์ผ๋ก (๋ฅ๋ฅ)
- overflow : ์์ผ๋ก ๋ง๋ค์์๋ ul ํ๊ทธ overflow ์์ ์ฃผ๊ธฐ
html ๋ชฉ๋ก - ol, ul, li
+ dl ( definition or description list ), dt, dd
+ dt ( term or subject in a definition or description list )
์ฉ์ด ๋๋ ์ ๋ชฉ dl ํ๊ทธ ์์์
+ dd ( A definition or description in a definition or description list )
<dl>
<dt>html</dt>
<dd>hypertext markup language</dd>
<dt>jsp</dt>
<dd>java server page</dd>
</dl>
1. ๋ชจ๋ html ์์(ํ๊ทธ)์๋ ์์ ์ ํ์ ๋ฐ๋ผ ๊ธฐ๋ณธ ํ์( display )๊ฐ์ด ์๋ค.
2. ํ์( display)
ใฑ) ๋ธ๋ญ๋ชจ๋ - ์ ์ฒด ๋๋น, : p, li, hn, dl, dt,dd, ol,ul,li, hr, blockquote, [div] ๋ฑ๋ฑ
ใด) ์ธ๋ผ์ธ๋ชจ๋ - ์ ๋ผ์ธ(์ค)์์ ์์ X, ํ์ฉํ ๋๋น ๋งํผ๋ง ์ฐจ์ง.
: img, a, span, i, q,sub,sup, b, button, input ๋ฑ๋ฑ
์ฐธ๊ณ ) ์ธ๋ผ์ธ ์์(ํ๊ทธ) ๋ ๋ธ๋ก ์์ค ์์(ํ๊ทธ)๋ฅผ ํฌํจํ ์ ์๋ค.
3. div ์์ / span ์์
1) ์น ํ์ด์ง์ ๋ฐฐ์น( layout )
2) ๋ธ๋ญ ๋ชจ๋
3) ๋ค๋ฅธ html ์์์ ์ปจํ ์ด๋๋ก ์ฌ์ฉ๋๋ค.
* span : ์ธ๋ผ์ธ, ํ ์คํธ ์ปจํ ์ด๋๋ก ์ฌ์ฉ
4. ์์ - ํ์ ์์ฑ id, class, style ๊ณตํต
<style>
span{
border: 1px solid gray;
width:200px;
display: inline-block;
text-align: center;
}
</style>
* ์ธ๋ผ์ธ ์ ์งํ๋ ๋ธ๋ญ๋ชจ๋(width ๊ฐ ์ฃผ๊ธฐ ์ํด)
์ฌ์ฉ์๊ฐ ๋ฒํผ ๋๋ฅด๋ฉด ์จ๊ธฐ๊ธฐ
<button onclick="spanHide();">์จ๊ธฐ๊ธฐ(hide)</button>
<button onclick="spanShow();">๋ณด์ด๊ธฐ(show)</button>
<br>
<br>
<span id="sp01" >๊น๊ฐ์จ</span><br>
<span id="sp02">์กฐ๋ฏผ๊ฒฝ</span><br>
<span id="sp03">์ํฌ์ง</span><br>
<span id="sp04">์ด์ฌ๋ฏผ</span><br>
<span id="sp05">์ํํ</span><br>
<span id="sp06">ํฉ์๋น</span><br>
<span id="sp07">๋ฐํ์</span><br>
JS
// js ์ฝ๋ฉํ๋ ์์ญ
// js ํจ์ ์ ์ธ - 3๊ฐ์ง ๊ณ ๋ ค( ๊ธฐ๋ฅ, ๋งค๊ฐ๋ณ์, ๋ฆฌํด๊ฐ )
// [js ๋์๋ฌธ์ ๊ตฌ๋ถํ๋ค. ]
<script>
function spanHide() {
// window.alert("์จ๊ธฐ๊ธฐ ๋ฒํผ ํด๋ฆญ๋จ!!!");
// js ํ์ด์ง ์ด๋
// document.location = "http://www.naver.com";
// location.href = "http://www.naver.com";
// js๋ก span ์์๋ฅผ ์ป์ด์์ ์จ๊ฒจ๋ผ.
// style="display: none;" ์ด ์ฝ๋ฉ์ ์๋ฐ ์คํฌ๋ฆฝํธ๋ก ์์
document.getElementById("sp01").style.display = "none";
document.getElementById("sp02").style.display = "none";
document.getElementById("sp03").style.display = "none";
document.getElementById("sp04").style.display = "none";
document.getElementById("sp05").style.display = "none";
document.getElementById("sp06").style.display = "none";
document.getElementById("sp07").style.display = "none";
window.alert("1์กฐ์ ์จ๊น!!!");
}
function spanShow() {
document.getElementById("sp01").style.display = "inline-block";
document.getElementById("sp02").style.display = "inline-block";
document.getElementById("sp03").style.display = "inline-block";
document.getElementById("sp04").style.display = "inline-block";
document.getElementById("sp05").style.display = "inline-block";
document.getElementById("sp06").style.display = "inline-block";
document.getElementById("sp07").style.display = "inline-block";
window.alert("1์กฐ์ ๋ํ๋!!!");
}
</script>
<script>
function spanHide(){
// ์์๋ฅผ ์ป์ด์ค๋ 1๋ฒ์งธ ๋ฐฉ๋ฒ getElementById(id);
// ์์๋ฅผ ์ป์ด์ค๋ 2๋ฒ์งธ ๋ฐฉ๋ฒ getElementsByTagName(tagName);
var spans = document.getElementsByTagName("span");
//window.alert( spans.length );
for (var i = 0; i < spans.length; i++) {
spans[i].style.display = "none";
} // for
}
function spanShow(){
var spans = document.getElementsByTagName("span");
for (var i = 0; i < spans.length; i++) {
spans[i].style.display = "inline-block";
} // for
}
</script>
-> better ์ฝ๋ฉ
<button onclick="spanHide();">์จ๊ธฐ๊ธฐ(hide)</button>
<button onclick="spanShow();">๋ณด์ด๊ธฐ(show)</button>
<br>
<br>
<div id="team01">
<span id="sp01" >๊น๊ฐ์จ</span><br>
<span id="sp02">์กฐ๋ฏผ๊ฒฝ</span><br>
<span id="sp03">์ํฌ์ง</span><br>
<span id="sp04">์ด์ฌ๋ฏผ</span><br>
<span id="sp05">์ํํ</span><br>
<span id="sp06">ํฉ์๋น</span><br>
<span id="sp07">๋ฐํ์</span><br>
</div>
<script>
function spanHide() {
document.getElementById("team01").style.display = "none";
}
function spanShow() {
document.getElementById("team01").style.display = "block";
}
</script>
-> ๋ค๋ฅธ ๋ฐฉ์
js ์ฝ๋ฉ์ jquery ์ฝ๋ฉ์ผ๋ก ์์
jQuery ๋ js ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค.
1) ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ถ๊ฐ
-> google cdn -> 3.x ์ค๋ํซ -> ํ ํ๋ฆฟ์ ์ถ๊ฐํ๊ธฐ
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<button id="btnHide" >์จ๊ธฐ๊ธฐ(hide)</button>
<button id="btnShow">๋ณด์ด๊ธฐ(show)</button>
<br>
<br>
<span id="sp01" >๊น๊ฐ์จ</span><br>
<span id="sp02">์กฐ๋ฏผ๊ฒฝ</span><br>
<span id="sp03">์ํฌ์ง</span><br>
<span id="sp04">์ด์ฌ๋ฏผ</span><br>
<span id="sp05">์ํํ</span><br>
<span id="sp06">ํฉ์๋น</span><br>
<span id="sp07">๋ฐํ์</span><br>
<script>
// ๊ธฐ์ต) script ํ๊ทธ๋ ํญ์ /body ์์ ์ฝ๋ฉ.
// js ์จ๊ธฐ๊ธฐ ๋ฒํผ ์ป์ด์ฌ๋๋ document.getElementById("btnHide")
// $ == jQuery
$("#btnHide").click( function (){ // ์ต๋ช
ํจ์
// window.alert("ํด๋ฆญ ์ด๋ฒคํธ ํ์ธ!!!");
/*
var spans = document.getElementsByTagName("span");
for (var i = 0; i < spans.length; i++) {
spans[i].style.display = "none";
} // for
*/
// jquery ํจ์ : css(์์ฑ๋ช
, ์์ฑ๊ฐ);
$("span").css("display", "none");
} );
$("#btnShow").click( function (){ // ์ต๋ช
ํจ์
$("span").css("display", "inline-block");
} );
</script>
1. https://ko.wikipedia.org/wiki/%EC%97%90%EB%B0%8B_(%EC%86%8C%ED%94%84%ED%8A%B8%EC%9B%A8%EC%96%B4)
2. ์๋ฐ(Emmet)์ HTML, XML, XSL ๋ฌธ์ ๋ฑ์ ํธ์งํ ๋ ๋น ๋ฅธ ์ฝ๋ฉ์ ์ํด ์ฌ์ฉํ๋ ํ๋ฌ๊ทธ์ธ์ด๋ค.
3. ์๋ ์ ์ฝ๋ฉ(Zen Coding)์ผ๋ก ๋ถ๋ฅด๋ค๊ฐ ์๋ฐ(Emmet)์ผ๋ก ์ด๋ฆ์ ๋ณ๊ฒฝํ๋ค.
4. [1] ๋งค์ฐ ๊ฐ๋จํ ๋ช ๊ฐ์ง ์ฝ๋๋ง ์ ๋ ฅํ๋ฉด, ์๋์ผ๋ก ์์ ํ HTML ์ฝ๋๋ฅผ ์์ฑํด ์ค๋ค.
6. Installation
ใฑ. Go to Help > Install New Software… in your Eclipse IDE
ใด. Add http://download.emmet.io/eclipse/updates/ in update sites
ใท. Check Emmet for Eclipse group in available plugins list, click Next button and follow the installation instructions
ใน. Restart Eclipse
7. Emmet์ css selector์ ์ ์ฌํ ๊ตฌ๋ฌธ์ ์ฌ์ฉํ๋ค.
Ctrl + E
์ค์ฒฉ์ฐ์ฐ์
1. > ์์(์ง๊ณ์์)
2. + ํ์ ์๋งค( ๋์ผํ ์์ค์ ์์ )
3. ^ ์์ ์์ค(๋ฑ๋ฐ)
4. ()
<!-- div>ul -->
<div>
<ul></ul>
</div>
<!-- div>ul>li -->
<div>
<ul>
<li></li>
</ul>
</div>
<!-- div+ul -->
<div></div>
<ul></ul>
<!-- div+ul+ol -->
<div></div>
<ul></ul>
<ol></ol>
<!-- div+p+bq -->
<div></div>
<p></p>
<blockquote>๊ธด์ธ์ฉ๋ฌธ</blockquote>
<!--
<div>
<p></p>
</div>
<p></p>
-->
<!-- div>p+p -->
<div>
<p></p>
<p></p>
</div>
<!-- div>p^p -->
<div>
<p></p>
</div>
<p></p>
<!--
<div>
<p>
<ul></ul>
</p>
</div>
<p></p>
-->
<!-- div>p>ul^^p -->
<div>
<p>
<ul></ul>
</p>
</div>
<p></p>
<!-- div+div>p>span+em^bq -->
<div></div>
<div>
<p><span></span><em></em></p>
<blockquote></blockquote>
</div>
<!-- div>ul>li+li+li+li+li -->
<div>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
<!-- div>ul>li*5 (ํ์) -->
<div>
<ul>
<li>ํ๊ธธ๋1</li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
<!-- ul>li*5>{ํ๊ธธ๋-} -->
<!-- ul>li*5>{ item-$ } -->
<!-- ul>li*5>{ item-$ } -->
<!-- ul>li*5>{ item-$$$ } -->
<ul>
<li> item-001 </li>
<li> item-002 </li>
<li> item-003 </li>
<li> item-004 </li>
<li> item-005 </li>
</ul>
<!-- ์๋ฉํฑ ํ๊ทธ -->
์๋ฏธ๊ฐ ๋ถ์ฌ๋ ํ๊ทธ
<div>
<header>
<ul>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
</ul>
</header>
<footer>
<p></p>
</footer>
</div>
๊ทธ๋ฃนํ
<!-- div>header>ul>li*2>a^^^footer>p -->
<div>
<header>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</header>
<footer>
<p></p>
</footer>
</div>
</body>
</html>
<!-- ํ์ ๊ทธ๋ฃนํ -->
<!-- div>(header>ul>li*2>a)+(footer>p) -->
<div>
<header>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</header>
<footer>
<p></p>
</footer>
</div>
<!-- ^^^ () -->
<!-- table>(tr>th*3)+(tr>td*3)*3 -->
<!-- table>(tr>th*3)+tr*3>td*3 -->
<table>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<!-- div>dl>(dt+dd)*5 -->
<div>
<dl>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
</dl>
</div>
์์ฑ์ฐ์ฐ์ : ์์์ ์์ฑ์ ์์ (์ถ๊ฐ)ํ๋ ๋ฐ ์ฌ์ฉํ๋ ์ฐ์ฐ์.
* ์์๋ช ์์ด #box ํ๋ฉด ๋ฐ๋ก div ์์ฑ
<!-- div -->
<!-- ์์[์์ฑ๋ช
=์์ฑ๊ฐ][์์ฑ๋ช
=์์ฑ๊ฐ] -->
<!-- div[id='box'][class='ss17 ss16 ss15'] -->
<div id="box" class="ss17 ss16 ss15"></div>
<!-- div#์์ด๋๋ช
.ํด๋์ค๋ช
-->
<!-- div[id='box'] -->
<!-- div#box -->
<!-- div#box.ss17 -->
<!-- div#box.ss17.ss16.ss15 -->
<div id="box" class="ss17 ss16 ss15"></div>
<!-- ์์๋ช
X #box -->
<div id="box"></div>
<!-- a[href='http://www.sist.co.kr'].16[target='_blank']>{์์ฉ๊ต์ก์ผํ}^br -->
<a href="http://www.sist.co.kr" class="16" target="_blank">์์ฉ๊ต์ก์ผํ</a><br>
<h3>๋ฒํธ ๋งค๊ธฐ๊ธฐ</h3>
<!-- ul>li.item*5 -->
<!-- ul>li.item$*5>{item-$$$} -->
<ul>
<li class="item1">item-001</li>
<li class="item2">item-002</li>
<li class="item3">item-003</li>
<li class="item4">item-004</li>
<li class="item5">item-005</li>
</ul>
<!-- ์ญ์์ผ๋ก ๋ฒํธ๋งค๊ธฐ๊ธฐ $ ๋ค์ @- ๋ฅผ ๋ถ์ด๋ฉด ๋๋ค. -->
<!-- ul>li.item$@-*5>{item-$$$} -->
<ul>
<li class="item5">item-001</li>
<li class="item4">item-002</li>
<li class="item3">item-003</li>
<li class="item2">item-004</li>
<li class="item1">item-005</li>
</ul>
<!-- ๋ฒํธ ๋งค๊ธฐ๊ธฐ 1๋ถํฐ~ X , 11๋ถํฐ ~ -->
<!-- ul>li*5>{item$} -->
<!-- ul>li*5>{item$@11} -->
<ul>
<li>item11</li>
<li>item12</li>
<li>item13</li>
<li>item14</li>
<li>item15</li>
</ul>
<!-- ul>li*5>{item$@-11} -->
<ul>
<li>item15</li>
<li>item14</li>
<li>item13</li>
<li>item12</li>
<li>item11</li>
</ul>
<!-- { ํ
์คํธ } -->
<a href="">click<b>here</b></a>
<!-- a>{click}+b>{here} -->
<a href="">click<b>here</b></a>
<!-- a{click}>b{here} -->
<a href="">click<b>here</b></a>
<p>Click <a href="">here</a> to continue</p>
<!-- p>{Click} ์ฐจ์ด์ -->
<!-- p{Click} ์ฐจ์ด์ -->
<!-- p{Click}>a{here}+{ to continue} -->
<p>Click<a href="">here</a> to continue</p>
<!-- (header>ul.nav>li*5)+footer -->
<header>
<ul class="nav">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</header>
<footer></footer>
<!-- p>lorem -->
<!-- ์ต๊ณ ์ ์
๋ก -->
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Doloremque consequatur sit voluptatibus nihil laborum id
quo voluptatem optio minima a explicabo veritatis quod
commodi ipsa placeat ratione totam. Accusantium eligendi.
</p>
<!-- ul>li*10>lorem1 -->
<ul>
<li>Lorem.</li>
<li>Omnis!</li>
<li>Nisi!</li>
<li>Officia.</li>
<li>Ab!</li>
<li>Quos!</li>
<li>Sint.</li>
<li>Vel.</li>
<li>Sequi.</li>
<li>Praesentium.</li>
</ul>
<!-- ul>li*10>lorem2 -->
<ul>
<li>Lorem ipsum.</li>
<li>Ab numquam!</li>
<li>Ducimus alias.</li>
<li>Magnam omnis!</li>
<li>Minima fuga.</li>
<li>Modi unde.</li>
<li>Adipisci totam.</li>
<li>Nulla omnis!</li>
<li>Inventore sint.</li>
<li>Blanditiis nam.</li>
</ul>
์ต๊ทผ๋๊ธ