CSS
CSS Syntax
selector {
property1: value1;
property2: value2;
}
Css
CSS (Cascading Style Sheets) is a styling language used controls the visual appearance of web pages, including elements’ layout, colors, fonts, and other design aspects. Here are some key points about CSS:
-
- Style Rules: CSS style rules consist of a selector and a declaration block. The declaration block contains one or more property-value pairs enclosed in curly braces.
- Selectors: CSS uses selectors to target specific HTML elements or groups of elements. Common selectors include element selectors (e.g.,
div
,p
,h1
), class selectors (e.g.,.my-class
), and ID selectors (e.g.,#my-id
). - Properties and Values: CSS properties define various aspects of an element’s appearance, such as
color
,font-size
,background-color
,padding
, andmargin
. Each property is assigned a value that specifies the desired visual style.
CSS is a fundamental technology in web development, allowing developers to separate the presentation layer from the content layer.