• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
Learn web development
  1. MDN
  2. Learn web development
  3. CSS
  4. Use CSS to solve common problems

Use CSS to solve common problems

The following links point to solutions to common everyday problems you'll need to solve with CSS.

Common use cases

Basics

  • How to apply CSS to HTML
  • How to use whitespace in CSS
  • How to write comments in CSS
  • How to select elements via element name, class or ID
  • How to select elements via attribute name and content
  • How to use pseudo-classes
  • How to use pseudo-elements
  • How to apply multiple selectors to the same rule
  • How to specify colors in CSS
  • How to debug CSS in the browser

CSS and text

  • How to style text
  • How to customize a list of elements
  • How to style links
  • How to add shadows to text

Boxes and layouts

  • How to size CSS boxes
  • How to control overflowing content
  • How to control the part of a CSS box that the background is drawn under
  • How do I define inline, block, and inline-block?
  • How to create fancy boxes (also see the Styling boxes module, generally).
  • How to use background-clip to control how much of the box your background image covers.
  • How to change the box model completely using box-sizing
  • How to control backgrounds
  • How to control borders
  • How to style an HTML table
  • How to add shadows to boxes

Uncommon or advanced techniques

Beyond the basics, CSS is allows very advanced design techniques. These articles help you tackle the hardest use cases you may face.

General

  • How to calculate specificity of a CSS selector
  • How to control inheritance in CSS

Advanced effects

  • How to use filters in CSS
  • How to use blend modes in CSS

Layout

  • Using CSS flexible boxes
  • Using CSS multi-column layouts
  • Using CSS generated content

See also

CSS FAQ — A collection of smaller bits of information, covering a variety of topics from debugging to selector usage.

Document Tags and Contributors

Tags: 
  • Beginner
  • CSS
  • Learn
 Contributors to this page: chrisdavidmills, hbloomer, Jeremie
 Last updated by: chrisdavidmills, Jan 17, 2017, 2:22:46 AM
See also
  1. Complete beginners start here!
  2. Getting started with the Web
    1. Getting started with the Web overview
    2. Installing basic software
    3. What will your website look like?
    4. Dealing with files
    5. HTML basics
    6. CSS basics
    7. JavaScript basics
    8. Publishing your website
    9. How the Web works
  3. HTML — Structuring the Web
  4. Introduction to HTML
    1. Introduction to HTML overview
    2. Getting started with HTML
    3. What's in the head? Metadata in HTML
    4. HTML text fundamentals
    5. Creating hyperlinks
    6. Advanced text formatting
    7. Document and website structure
    8. Debugging HTML
    9. Assessment: Marking up a letter
    10. Assessment: Structuring a page of content
  5. Multimedia and embedding
    1. Multimedia and embedding overview
    2. Images in HTML
    3. Video and audio content
    4. From object to iframe — other embedding technologies
    5. Adding vector graphics to the Web
    6. Responsive images
    7. Assessment: Mozilla splash page
  6. CSS — Styling the Web
  7. Introduction to CSS
    1. Introduction to CSS overview
    2. How CSS works
    3. CSS syntax
    4. Selectors introduction
    5. Simple selectors
    6. Attribute selectors
    7. Pseudo-classes and pseudo-elements
    8. Combinators and multiple selectors
    9. CSS values and units
    10. Cascade and inheritance
    11. The box model
    12. Debugging CSS
    13. Assessment: Fundamental CSS comprehension
  8. Styling text
    1. Styling text overview
    2. Fundamental text and font styling
    3. Styling lists
    4. Styling links
    5. Web fonts
    6. Assessment: Typesetting a community school homepage
  9. Styling boxes
    1. Styling boxes overview
    2. Box model recap
    3. Backgrounds
    4. Borders
    5. Styling tables
    6. Advanced box effects
    7. Assessment: Creating fancy letterheaded paper
    8. Assessment: A cool-looking box
  10. CSS layout
    1. CSS layout overview
    2. Floats
    3. Positioning
    4. Practical positioning examples
    5. Flexbox
    6. Grids
  11. JavaScript — Dynamic client-side scripting
  12. JavaScript first steps
    1. JavaScript first steps overview
    2. What is JavaScript?
    3. A first splash into JavaScript
    4. What went wrong? Troubleshooting JavaScript
    5. Storing the information you need — Variables
    6. Basic in JavaScript — Numbers and operators
    7. Handling text — Strings in JavaScript
    8. Useful string methods
    9. Arrays
    10. Assessment: Silly story generator
  13. JavaScript building blocks
    1. JavaScript building blocks overview
    2. Making decisions in your code — Conditionals
    3. Looping code
    4. Functions — Reusable blocks of code
    5. Build your own function
    6. Function return values
    7. Introduction to events
    8. Assessment: Image gallery
  14. Introducing JavaScript objects
    1. Introducing JavaScript objects overview
    2. Object basics
    3. Object-oriented JavaScript for beginners
    4. Object prototypes
    5. Inheritance in JavaScript
    6. Working with JSON data
    7. Object building practise
    8. Assessment: Adding features to our bouncing balls demo
  15. Tools and testing
  16. Cross browser testing
    1. Cross browser testing overview
    2. Introduction to cross browser testing
    3. Strategies for carrying out testing
    4. Handling common HTML and CSS problems
    5. Handling common JavaScript problems
    6. Handling common accessibility problems
    7. Implementing feature detection
    8. Introduction to automated testing
    9. Setting up your own test automation environment
  17. Server-side website programming
  18. First steps
    1. First steps overview
    2. Introduction to the server-side
    3. Client-Server overview
    4. Server-side web frameworks
    5. Website security
  19. Django web framework (Python)
    1. Django web framework (Python) overview
    2. Introduction
    3. Setting up a development environment
    4. Tutorial: The Local Library website
    5. Tutorial Part 2: Creating a skeleton website
    6. Tutorial Part 3: Using models
    7. Tutorial Part 4: Django admin site
    8. Tutorial Part 5: Creating our home page
    9. Tutorial Part 6: Generic list and detail views
    10. Tutorial Part 7: Sessions framework
    11. Tutorial Part 8: User authentication and permissions
    12. Tutorial Part 9: Working with forms
    13. Tutorial Part 10: Testing a Django web application
    14. Tutorial Part 11: Deploying Django to production
    15. Web application security
    16. Assessment: DIY mini blog
  20. Further resources
  21. Advanced learning material
    1. WebGL: Graphics processing
  22. Common questions
    1. HTML questions
    2. CSS questions
    3. How the Web works
    4. Tools and setup
    5. Design and accessibility
  23. How to contribute