Ctrl + F5
<div>
, <p>
, <h1>
, <form>
, <table>
, etc.<span>
, <a>
, <img>
, <input>
, <label>
, etc.<article>
, <footer>
이런 거<div id="article">
로 쓰면 HTML reader가 읽을 때 그냥 <div>
로 읽음각 구역에 대한 설명은 W3Schools 참고.
<article>
과 <section>
<article>
은 독립적인, 본문과 다른 내용 중 자체적으로 어떤 주제를 포함하는 경우<section>
은 그 안에서 나뉘는 구역border-box
Vs. content-box
border-box
의 width
를 100px로 지정해도 실제 content가 차지하는 너비는 100px보다 작아질 수 있다.<pre>
<form>
<form>
태그.action
"{{URL}}"
"/{{URL}}"
은 절대 경로, "{{URL}}"
은 상대 경로method
enctype
"text/plain"
"multipart/form-data"
<input>
class
를 주는 건 CSS를 적용하기 위함/**/
뿐이다(#
, //
없음).<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<head>
<style type="text/css">
body { margin: 0; padding: 0}
p { color : red; }
</style>
</head>
<p style="color:red; border:1px solid #000:"> This is a paragraph. </p>
href
만 변경하면 된다.p {
color: red;
}
#aa {
color: yellow;
}
.bb {
color: blue;
}
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<title>CSS Page</title>
</head>
<body>
<p style="color:green">This is a paragraph.</p>
<p id="aa">This is a paragraph.</p>
<p class="bb">This is a paragraph.</p>
<p class="bb" id="aa">This is a paragraph.</p>
<p id="aa" class="bb">This is a paragraph.</p>
<p id="aa" class="bb" style="color: green">This is a paragraph.</p>
</body>
</html>
우선순위는 inline > id
> class
> Tag 순으로 높다.
p {
color: red;
}
#aa { /*원래는 [id=aa] {인데 id와 class만 축약할 수 있음*/
color: yellow;
}
.bb { /*원래는 [class=bb] {인데 id와 class만 축약할 수 있음*/
color: blue;
}
* { /* Wild card */
}
p, h1 { /*한 번에 여러 tag에도 적용할 수 있음 */
}
p h1 { /* p 태그 안의 모든 h1 */
}
p > h1 { /* p 바로 밑의 h1만 */
}
<head>
안에 두도록 했지만 요즘은 다시 <body>
안의 맨끝에 두는 추세i=100
으로 선언하면 무조건 global variablevar
undefined
로 초기화됨var i = 10 // 가능
...
var i = 200 // 이것도 가능
let
var
쓰다보니까 짜증나서 ES6부터 let
, const
가 추가됨(hoisting 없음)let
은 재선언 불가, block scope