
<!doctype html>
<html>
<head>
<title>CSS Selector</title>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Nanum+Pen+Script&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Nanum Pen Script', cursive;
}
h1 {
font-family: 'Black Han Sans', sans-serif;
}
/* ์ฐ๊ฒฐ(๋ณตํฉ)์ ํ์ */
img+p {
font-style: italic;
}
/* img์ ์ฒซ์งธ๋์ p ์ ํ */
p~span {
color: red;
}
/*p์ ๋์์ธ span๋ค์ ๋ชจ๋ ์ ํ*/
/* ์์ฑ ์ ํ์ */
a[href] {
color: red;
}
/* ๊ฐ์ด ์ผ์นํ๋ ์์ ์ ํ */
a[href="http://example.com"] {
color: orange;
}
/* ๊ณผ ์์ฑ๊ฐ์ด ์ผ์นํ๋ ์์ ์ ํ */
a[href ^="#"] {
color: green;
}
/* ๊ฐ์ผ๋ก ์์ํ๋ ์์ ์ ํ */
a[href $=".org"] {
color: orchid;
}
/* ๊ฐ์ผ๋ก ๋๋๋ ์์ ์ ํ */
a[href *="example"] {
color: blueviolet;
}
/* ๊ฐ์ด ๋ค์ด์๋ ์์ ์ ํ */
a[href~="example"] {
color: darkcyan;
}
/* ๊ฐ์ ์ ๋ค์ ๊ณต๋ฐฑ์ด ์๋ ํํ์ ์์ ์ ํ */
/* ์
๋ ฅ์์ ๋ง๋ค ๋ ์์ฃผ ์ */
input[type="text"] {
/* input ์์ ์ค์ text ํ์
์ธ ๊ฒ */
background-color: skyblue;
}
/* ๊ฐ์ ํด๋์ค ์ ํ์ */
a:hover {
background-color: orange;
}
a:link {
color: red;
}
a:visited {
color: darkgoldenrod;
}
a:active {
color: darkgreen;
}
input:focus {
/* ์
๋ ฅ๋ฐ์ค์ค์ ํ์ฌ ๋ง์ฐ์ค๋ก ์ ํ๋ ๊ฒ ์ง์ */
background-color: beige;
border: 3px solid blue;
}
p:first-of-type {
/* */
border-bottom: 2px dotted red;
}
li:first-child {
background-color: aqua;
}
li:last-child {
background-color: violet;
}
li:nth-child(2) {
/* ๋ ๋ฒ์งธ ๊ฒ ์ ํ. 2 ์๋ฆฌ์ ์ซ์๋ฅผ ๋ฃ์ด์ ์ํ๋ ๊ฒ ์ ํ ๊ฐ๋ฅ. 2 ๋ค์ n์ ๋ถ์ด๋ฉด ์ง์๋ฒ์งธ ์ ํ 2n+1์ ํ์๋ฒ์งธ
or
even ์ง์
odd ํ์๋ ๊ฐ๋ฅ*/
background-color: olivedrab;
}
/* ๊ฐ์ ์์ ์ ํ์ */
h1::first-letter {
font-size: 1.5em;
}
p::first-line {
background-color: bisque;
}
p>a::after {
content: "!!!!";
border: 1px dotted red;
}
span[data-descr] {
position: relative;
text-decoration: underline;
color: #00f;
cursor: pointer;
}
span[data-descr]:focus::after {
content: attr(data-descr);
/* attr()ํจ์๋ ์์ฑ๊ฐ์ ์ฝ์ด์ด */
position: absolute;
left: 0;
top: 24px;
min-width: 200px;
border: 1px solid #aaa;
border-radius: 10px;
background-color: #ffffcc;
padding: 12px;
font-size: 14px;
z-index: 1;
}
table,
th,
td {
border: 1px solid black;
border-collapse: collapse;
}
table {
width: 50%;
margin: 0 auto;
height: 300px;
}
td {
text-align: center;
vertical-align: center;
}
tr:nth-child(even) {
background-color: skyblue;
}
</style>
</head>
<body>
<h1>CSS combinators(์กฐํฉ์ ํ์)</h1>
<div>
<img src="">
<p>Empty Image<br>Image2</p>
<span>This is not red.</span>
<p>Here is a paragraph.</p>
<code>Here is some code.</code>
<pre></pre>
<span>And here is a red span!</span>
<code>More code...</code>
<span>And this is a red span!</span>
</div>
<h1>CSS attribute selector(์์ฑ์ ํ์)</h1>
<ul>
<li><a href="#internal">Internal link</a></li>
<li><a href="http://example.com">Example link</a></li>
<li><a href="#InSensitive">Insensitive internal link</a></li>
<li><a href="http://example.org example">Example org link</a></li>
</ul>
<div lang="en-us en-gb en-au en-nz">Hello World!</div>
<div lang="pt">Olรก Mundo!</div>
<div lang="zh-CN">ไธ็ๆจๅฅฝ๏ผ</div>
<div lang="zh-TW">ไธ็ๆจๅฅฝ๏ผ</div>
<div data-lang="zh-TW">?ไธ็ๆจๅฅฝ๏ผ</div>
<ul>
<li class="number">One</li>
<li class="number">Two!</li>
<li class="number">Three</li>
<li class="number">Four</li>
</ul>
<h1>CSS pseudo-classes(๊ฐ์ํด๋์ค)</h1>
<p>๊ฐ์ ํด๋์ค๋ ์์์ ํน์ ์ํ์ ๋ฐ๋ผ ์คํ์ผ์ ์ ์ํ ๋ ์ฌ์ฉ๋๋ค. ํน์ ์ํ๋ ์๋ฅผ ๋ค์ด ๋ค์๊ณผ ๊ฐ๋ค.</p>
<p>Mouse over and click the link: <a href="https://www.google.com">Google.com</a></p>
<p>์ด ์์ ๋
<span tabindex="0" data-descr="๋จ์ด์ ๋ฌธ์ฅ ๋ถํธ์ ์งํฉ">ํ
์คํธ</span>์ ํจ๊ป ์ฝ๊ฐ์
<span tabindex="0" data-descr="ํธ๋ฒ ์ ๋ณด์ฌ์ง๋ ์์ ํ์
">ํดํ</span>์ ํฌํจํฉ๋๋ค.
</p>
<input type="text" placeholder="Your name...">
<hr>
<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>
<tr>
<td>Jessy</td>
<td>White</td>
<td>$270</td>
</tr>
<tr>
<td>Harry</td>
<td>Hunt</td>
<td>$330</td>
</tr>
</table>
</body>
</html>
LIST
'๐ Coding Study > ์น ๋์์ธ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
2023.04.05 ์ (HTML ๋ฐ์ค๋ชจ๋ธ, ๋ฐ์ค์ฌ์ด์ง, *์ ํ์ ๋ฑ) (0) | 2023.04.05 |
---|---|
2023.04.03 ์ (HTML position) (0) | 2023.04.03 |
2023.03.29 ์ (CSS ์ค์ต) (0) | 2023.03.29 |
2023.03.27 ์ (CSS) (0) | 2023.03.27 |
2023.03.22 ์ (HTML ๋ฉํฐ๋ฏธ๋์ด ์๋ฃ ํ๊ทธ) (0) | 2023.03.22 |