CSS Basics: Colors, Fonts, and Spacing ๐จ๐๏ธ๐
This evening, letโs delve into some basic CSS properties that can drastically change the look of your HTML pages.
Colors in CSS can be specified by the following methods:
name (red ๐ฅ),
HEX (
#FF0000 ๐จ),
RGB (rgb(255, 0, 0) ๐),
or HSL (hsl(0, 100%, 50%) ๐จ).
For instance, body {color: red;} will make the text color red.
Fonts can be changed using the font-family property ๐๏ธ, and the size can be adjusted with font-size ๐.
For example: body {font-family: Arial, sans-serif; font-size: 16px;} will set Arial as the font with a size of 16 pixels.
Spacing is controlled through properties like margin (space outside elements โก๏ธ), padding (space inside elements โฌ
๏ธ), and border (outline of elements ๐).
For instance, p { margin: 20px; padding: 10px; border: 2px solid black;} will style all paragraph elements with specified margin, padding, and border.
Stay tuned as we dive deeper into CSS and further our web development adventure over the next two weeks!
#WebDevelopment #CSSBasics #CodingBeginner #html #coding #react #javascript