What is CSS?

Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML or XML. It controls layout, colors, fonts, and other visual aspects.

css_guide

Key Concepts

  • Selectors: Target HTML elements (e.g., .class, #id, element)
  • Properties & Values: Define styles like color: red;
  • Cascading: Styles are applied based on specificity and order
  • Inheritance: Child elements inherit properties from parents

CSS Fundamentals

Use @import or <link> to include CSS files. Example:

<link rel="stylesheet" href="/css_guide.css">
css_101

Layout Techniques

  • Flexbox: For flexible, one-dimensional layouts
  • Grid: For two-dimensional layouts
  • Positioning: absolute, relative, fixed
  • Z-index: Control stacking order

Explore advanced topics in our CSS Layout Guide 🔗

css_flex_layout
css_grid_layout

Responsive Design

  • Use media queries for different screen sizes
  • max-width and min-width for fluid layouts
  • flex-wrap and grid-auto-columns for adaptability
responsive_design
Check our [Responsive Web Design Guide](/en/guides/responsive_design) for more examples 📚

Resources

Happy styling! 🌟