Safe Area Padding
CSS
Hard
3 views
Problem Description
Add padding that respects mobile safe areas (notch).
Output Format
Print the HTML+CSS code in one block.
Constraints
Use env(safe-area-inset-*) with fallback 0.
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>
header { padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px 16px; background: #111; color: #fff; }
</style>
</head>
<body>
<header>meetcode</header>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!