Anda di halaman 1dari 4

HTML

<!-- bla bla -->

<img src="" alt=>

<a href="">Bla bla</a>

<a href="#(id)">Bla bla</a> (internal link)

"#" - dead link

id=""

target="_blank"

nest links within other text elements

<ul>

<li> </li>

<li> </li>

</ul> ---- unordered list

<ol> --- ordered list

<input type="text" required (bat buoc dien) placeholder="this is placeholder text">

<form action=""> </form>

<button type="submit">this button submits the form</button>

<label for="indoor">

<input type="radio" id="indoor" name="indoor-outdoor">Indoor

</label> ----------- radio button (dau tich)

<label for="indoor">

<input type="checkbox" id="indoor" name="indoor-outdoor">Indoor

</label> ----------- checkbox (co the chon nhieu khac radio)


checked attribute

<br>

<div> </div>

<!DOCTYPE html>

<html>

</html>

<head></head> + <body></body> ----- for organizing

CSS

<h2 style="color: blue;">CatPhotoApp</h2> --- inline CSS

other way: <style> h2 {color: blue;} </style> at the top of your code

class css: <style> .blue-text {color: blue;} </style> ------- then inline: class="blue-text" (add more
class: class="class1 class2")

font-size: 30px;

font-family: sans-serif (family name - case-sensitive, use quotes for two or more words in the
name), generic name (degrade - font in case other font is not available);

default fonts: monospace, serif, sanserif (not case-sensitive

https://fonts.google.com/

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">


--- copy google font and paste on top of the code editor (b4 style)

width: 50px

border: color, width, style, radius (round corner- pixels or %)

background-color: silver
id -------> use # in style

margin, border and padding:

padding: space between the element's content and its border (padding/padding-top-right-
bottom-left)

margin: space between an element's border and surrounding elements (has negative margin)
(margin/margin-top left bottom right)

Instead of top right bot left: padding: 10px 20p 10px 20px (clockwise)

CSS selectors: id, class, [attr=value] (t[type="radio"]

style body element just like any other HTML element (class will be prioritized < the later class in
<style> is prioritized too - means that browsers read CSS from top to bottom < id attribute will
always take precedence < inline styles < color: red !important;)

use hex code/RGB value instead of color (#000000 / rgb(0, 0, 0))

--penguin-skin: gray -------------variable assign

background: var(--penguin-skin); ------------ variable use

background: var(--penguin-skin, black);-------------fallback value - useful for debugging

background: red;

background: var(--red-color); --------------- add another background before in case variable is not
supported - to improve compatibility

:root -------- set the value of variable for the whole page

Anda mungkin juga menyukai