Professional Documents
Culture Documents
—
thẻ thông dụng
h1 - h6 (heading) chữ nhỏ dần
p (paragraph) đoạn văn
img (image) src: link ảnh alt: thay thế khi ảnh lỗi
a (anchor) gắn link vào van ban
ul, li : unordered list, list ul bao bên ngoài và mỗi list sẽ là 1 li
table : thead: những mục trong table ,th cho mỗi mục
tbody: thân table
ứng với mỗi hàng thì tr, mỗi td ứng với mỗi mục
input để nhập
button
div khối
-->
<!--
Attribute
-->
<!--
dùng css có 3 cách: internal, external, inline
internal: viết thẳng vào html
dùng style
-->
<!--
id: khi css thì dùng #
class nhiều thằng dùng chung, dùng .
các selector cơ bản
.class.class những class có 2 chữ class và class trong thì lấy (.n1.n2 =>
class="n1 n2" or class="n2 n1" là lấy)
.class1 .class2 thì lấy class2 là con class1
* là lấy hết
-->
Một thẻ có thể có nhiều class, mỗi class cách nhau bằng 1 khoảng trắng (dấu space).
Priority
1. Internal external
2. Inline -1000
3. #id – 100
4. .class – 10
5. Tag -1
! important to nhất
Variable
Type Description
Text:
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname">
</form>
Radio button
<form>
<input type="radio" id="html" name="fav_language" value="HTML">
<label for="html">HTML</label><br>
<input type="radio" id="css" name="fav_language" value="CSS">
<label for="css">CSS</label><br>
<input type="radio" id="javascript" name="fav_language" value="JavaScri
pt">
<label for="javascript">JavaScript</label>
</form>
Check box:
<form>
<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike">
<label for="vehicle1"> I have a bike</label><br>
<input type="checkbox" id="vehicle2" name="vehicle2" value="Car">
<label for="vehicle2"> I have a car</label><br>
<input type="checkbox" id="vehicle3" name="vehicle3" value="Boat">
<label for="vehicle3"> I have a boat</label>
</form>
Submit box
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="Submit">
</form>
Select:
Button curser
:root {
--tên biến
Unit
Absolute
px
Relative
Hàm css
Dùng để style element trong 1 tình huống đặc biệt(k style từ đầu)
:last-child
Pseudo element
Padding
Padding-top,right,left,bottom
Border
Border-width:
Box-sizing
Box-sizing: border-box;
Background-size
Background-clip
Border-box: đổ từ viền
Padding-box: đổ từ padding
Content-box: đổ từ content
Background-origin
Background-position
Position
Sticky:
img onerror=””
list :
bo góc : radius
The problem with the <div> above occurs when the browser window is smaller
than the width of the element (500px). The browser then adds a horizontal
scrollbar to the page.
Using max-width instead, in this situation, will improve the browser's handling of
small windows.
When the text-align property is set to "justify", each line is stretched so that
every line has equal width, and the left and right margins are straight (like in
magazines and newspapers):
The text-indent property is used to specify the indentation of the first line of a
text:
Justify-content
Align-items
Align-content
flex-start: Lines are packed at the top of the container.
flex-end: Lines are packed at the bottom of the container.
center: Lines are packed at the vertical center of the container.
space-between: Lines display with equal spacing between them.
space-around: Lines display with equal spacing around them.
stretch: Lines are stretched to fit the container.
JS
Biến:
var tenbien =
1. Alert: in pop-up
2. Console : in ra trong console (debug)
-console.log(‘…’)
-console.warn()
-console.error()
3. Confirm : giống alert
-confirm(‘…’)
4. Prompt
-giống confirm có thêm ô input
5. Set timeout : chạy function sau 1000ms
-setTimeout(function () {
Alert(‘..’)
}, 1000)
6. Set interval: sau 1000ms nó lại chạy function
-setInterval(function () {
Alert(‘..’)
}, 1000)
Toán tử:
Function
object
var tên = {
name : ‘Linh’,
age: 20,
address: ‘Hanoi’
Array
1. false
2. 0 (số không)
3. '' or "" (chuỗi rỗng)
4. null
5. undefined
6. NaN
Hàm
function tenham() {
}
For
myString += ‘${para} - ’
String
.length