HTML Code

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:

  1. Separation of Content & Design – CSS separates structure (HTML) from presentation, making websites easier to maintain.
  2. Selectors & Rules – CSS applies styles using selectors (e.g., elements, classes, IDs) and rules (e.g., color: red;).
  3. Cascading & Specificity – Rules are applied based on hierarchy and specificity.
  4. Box Model – Defines how elements are displayed and spaced.
  5. 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 */ }
Scroll to Top