WEB DEVELOPMENT

CSS

November 13, 2024

CSS

CSS is a stylesheet language used to describe the presentation and formatting of a document written in HTML (or XML). CSS defines how elements within a web page should be displayed, including their layout, colors, fonts, spacing, and other visual aspects.

Key Concepts of CSS:

  • Selectors: Define the HTML elements to which styles are applied (e.g., div, p, .class, #id).
  • Properties: Define what aspect of the element you want to style (e.g., color, font-size, margin).
  • Values: Assign specific values to the properties (e.g., color: red, font-size: 16px).
  • How CSS Works:

  • Inline CSS: Styles applied directly within an HTML element using the style attribute.
  • Internal CSS: Styles defined within a style tag in the head section of an HTML document.
  • External CSS: Styles stored in an external file with a .css extension, linked to an HTML document using the link tag.
  • Key Features:

  • Responsive Design: CSS enables designs to adapt to different screen sizes (using media queries).
  • Box Model: Defines how elements are structured, including padding, border, margin, and content area.
  • Flexbox & Grid: Layout systems for creating flexible and complex web page structures.
  • CSS is essential for creating attractive and well-organized websites, allowing designers to control the visual appearance without altering the HTML content.