User:Zuhui/Prototyping/HTML/CSS: Difference between revisions
< User:Zuhui | Prototyping
(→fixed) |
|||
Line 25: | Line 25: | ||
===Position=== | ===Position=== | ||
====absolute==== | ====position: absolute;==== | ||
it is fixed on the designated position | it is fixed on the designated position | ||
====position: fixed;==== | ====position: fixed;==== | ||
it is fixed on the designated position + it stays float in the position even if the page is being scrolled | it is fixed on the designated position + it stays float in the position even if the page is being scrolled |
Revision as of 12:32, 12 November 2024
Basic
HTML
HTML basic structure
<!DOCTYPE html> <html> <head> <title></title> </head> <body> </body> </html>
CSS
:root
:root{ --(name of the var):(color, fontsize etc); } //-- two dash is mendatory
//when use ex) font-size: var(--main-font-size);
Position
position: absolute;
it is fixed on the designated position
position: fixed;
it is fixed on the designated position + it stays float in the position even if the page is being scrolled