Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Social-Links-Profile

suri1210 20

@suri1210

Desktop design screenshot for the Social links profile coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What challenges did you encounter, and how did you overcome them?

How to upload a solution is bigger challenge for me . After learning Git It makes me easy to Submit

What specific areas of your project would you like help with?

At Page setting max-width of mobile and desktop

Community feedback

MikDra1 6,070

@MikDra1

Posted

To set a maximum width for both mobile and desktop views on a webpage, you can use CSS media queries to define different styles based on the screen size. Here's how you can do it:

CSS Example

/* Default Styles (Mobile First) */
body {
    margin: 0 auto;
    max-width: 100%; /* Ensures content fits within the viewport */
    padding: 0 16px; /* Adds some padding for smaller screens */
}

/* Desktop Styles */
@media (min-width: 768px) {
    body {
        max-width: 1200px; /* Sets the max-width for larger screens */
        padding: 0 32px; /* Adds padding on larger screens */
    }
}

Explanation:

  • Mobile First: The default max-width: 100% ensures that the content takes up the full width of smaller screens, with some padding for spacing.

  • Desktop: The @media (min-width: 768px) query applies styles when the screen width is 768px or larger, typically targeting tablets and desktops. Here, max-width: 1200px ensures that the content doesn’t exceed this width on larger screens, and additional padding is added.

This approach creates a responsive design that adjusts well to both mobile and desktop environments.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord