How can you create a responsive design with CSS?
Instruction: Describe techniques for creating responsive web designs using CSS.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Build a layout that fits its available space, then add breakpoints where the content needs a different arrangement. Combine flexible sizing, Grid or Flexbox, responsive media and appropriate viewport configuration.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS example</title> <style> * { box-sizing: border-box; } .cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); } .cards > article { min-inline-size: 0; overflow-wrap: anywhere; padding: 1rem; border:...
Related Questions
-
medium
-
medium
-
hard
-
hard
-
hard