How do you create a responsive design using CSS?

Subh Prakash Singh
Invent the Future
To create a responsive design in CSS, you use media queries to apply different styles based on the device's screen size. Additionally, you use flexible layouts and elements (like percentages for width) that adjust automatically to different screen sizes. This ensures the design works well on various devices, from desktops to mobile phones. For example,
/* Default style for larger screens */
body { font-size: 16px; }
@media (max-width: 768px) {
/* Styles for smaller screens */
body { font-size: 14px; }
}









