CSS
CSS (Cascading Style Sheets) is a stylesheet language used to control the presentation, layout, and styling of HTML documents. It allows web developers to apply styles such as colors, fonts, spacing, and positioning to elements on a webpage.
Key Features of CSS:
- Separation of Content & Design – CSS separates structure (HTML) from presentation, making websites easier to maintain.
- Selectors & Rules – CSS applies styles using selectors (e.g., elements, classes, IDs) and rules (e.g.,
color: red;
). - Cascading & Specificity – Rules are applied based on hierarchy and specificity.
- Box Model – Defines how elements are displayed and spaced.
- Responsive Design – CSS supports media queries for mobile-friendly layouts.
CSS Syntax Example:
/* Applying styles to a paragraph */
p {
color: blue; /* Text color */
font-size: 16px; /* Font size */
margin: 10px; /* Spacing */
}