Mobile First Card Width

Mobile First Card Width

Medium CSS Responsive Design 13 views
Explanation Complexity

Problem Statement

Write mobile-first CSS: card is full width, then fixed width on large screens.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Start with small screen styles, then add min-width media query.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Start with small screen styles, then add min-width media query.

Examples

Input:
Output:
(HTML+CSS code)

Example Solution (Public)

CSS
<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    .card { width: 100%; border: 1px solid #eee; border-radius: 14px; padding: 14px; box-sizing: border-box; }
    @media (min-width: 800px) { .card { width: 420px; } }
  </style>
</head>
<body>
  <div class='card'>meetcode card</div>
</body>
</html>

Official Solution Code

<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    .card { width: 100%; border: 1px solid #eee; border-radius: 14px; padding: 14px; box-sizing: border-box; }
    @media (min-width: 800px) { .card { width: 420px; } }
  </style>
</head>
<body>
  <div class='card'>meetcode card</div>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.