Orientation Layout Change
CSS
Hard
2 views
Problem Description
Switch layout when phone is in landscape orientation.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use @media (orientation: landscape).
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
<style>
.box { padding: 16px; border: 1px solid #eee; border-radius: 14px; }
@media (orientation: landscape) {
.box { background: #eafaf1; }
}
</style>
</head>
<body>
<div class='box'>Rotate screen to see the change on meetcode.</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!