Aspect Ratio Preview

Aspect Ratio Preview

Medium CSS Box Model & Sizing 23 views
Explanation Complexity

Problem Statement

Create a fixed preview box using aspect-ratio 16/9.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use aspect-ratio and center text inside.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use aspect-ratio and center text inside.

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>
    .preview { width: 360px; aspect-ratio: 16 / 9; border: 2px solid #0b5; border-radius: 14px; display: grid; place-items: center; }
  </style>
</head>
<body>
  <div class='preview'>meetcode preview</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>
    .preview { width: 360px; aspect-ratio: 16 / 9; border: 2px solid #0b5; border-radius: 14px; display: grid; place-items: center; }
  </style>
</head>
<body>
  <div class='preview'>meetcode preview</div>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.