Skip to main content
coding intermediate

Create Responsive CSS Layout

Generate production-ready responsive CSS layouts with flexbox, grid, and mobile-first design. Perfect for frontend developers.

Works with: chatgptclaudegemini

Prompt Template

Create a responsive CSS layout for [LAYOUT_TYPE] with the following specifications: Layout Requirements: - Type: [LAYOUT_TYPE] - Main sections: [SECTIONS] - Color scheme: [COLOR_SCHEME] - Breakpoints: Mobile (320px+), Tablet (768px+), Desktop (1024px+) Technical Requirements: 1. Use modern CSS techniques (Grid/Flexbox) 2. Implement mobile-first approach 3. Include smooth transitions and hover effects 4. Ensure accessibility with proper contrast ratios 5. Add CSS variables for maintainability 6. Include print stylesheet considerations Provide: 1. Complete HTML structure with semantic elements 2. Full CSS with detailed comments 3. Media queries for all breakpoints 4. CSS Grid or Flexbox implementation (specify which is better for this layout) 5. Typography scaling using clamp() or similar 6. Interactive elements styling Optimization requirements: - Minimize CSS specificity conflicts - Use efficient selectors - Include fallbacks for older browsers - Optimize for Core Web Vitals Additional considerations: - [SPECIAL_REQUIREMENTS] - Browser support: [BROWSER_SUPPORT] Format the output with clear sections for HTML and CSS, and include brief explanations for key design decisions.

Variables to Customize

[LAYOUT_TYPE]

The type of layout you want to create

Example: e-commerce product page

[SECTIONS]

Main sections or components needed

Example: header with navigation, hero section, product grid, sidebar filters, footer

[COLOR_SCHEME]

Preferred color palette

Example: modern dark theme with blue accents (#1a1a1a, #2563eb, #ffffff)

[SPECIAL_REQUIREMENTS]

Any specific features or constraints

Example: sticky navigation, parallax scrolling, image lazy loading

[BROWSER_SUPPORT]

Required browser compatibility

Example: Modern browsers (Chrome 90+, Firefox 88+, Safari 14+)

Example Output

# E-commerce Product Page Layout ## HTML Structure ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Product Page</title> </head> <body> <header class="header"> <nav class="nav">...</nav> </header> <main class="main"> <section class="hero">...</section> <div class="content-wrapper"> <aside class="sidebar">...</aside> <section class="product-grid">...</section> </div> </main> <footer class="footer">...</footer> </body> </html> ``` ## CSS Implementation ```css :root { --primary-bg: #1a1a1a; --accent-color: #2563eb; --text-color: #ffffff; --container-max: 1200px; } .content-wrapper { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; max-width: var(--container-max); margin: 0 auto; } @media (max-width: 768px) { .content-wrapper { grid-template-columns: 1fr; gap: 1rem; } } ``` **Key Design Decisions:** - CSS Grid for main layout provides better control - Mobile-first approach ensures optimal performance - CSS custom properties enable easy theme customization

Pro Tips for Best Results

  • Always start with mobile-first design to ensure better performance on smaller devices
  • Use CSS Grid for 2D layouts and Flexbox for 1D component alignment
  • Test your layout with browser dev tools' device simulation across multiple breakpoints
  • Include CSS custom properties for colors and spacing to make maintenance easier
  • Validate your CSS and test accessibility with tools like WAVE or axe

Tags

Want 500+ Expert Prompts?

Get the Premium Prompt Pack — organized, tested, and ready to use.

Get it for $29

Related Prompts You Might Like