In this task, you need to fill the box while preserving the aspect ratio using the correct property you've learned in this topic.
object-fit and object-position
Fill the box
Report a typo
Write HTML and CSS code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<img src="https://images.freeimages.com/images/large-previews/576/green-hill-1-1171489.jpg" alt="Nature">
</body>
</html>
Completed 1 of 2
Fill the box while preserving its aspect ratio
The code is valid
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.