Viewport
Viewport
We're going to have a small letterbox-style viewport that will contain our sea/ports/ship:
Challenge
Use HTML and CSS (including flexbox) to create the above.
To complete this challenge, you will need to:
- Style your
html
andbody
elements so they have a height of100%
. - Style your
body
so its background is black. - Set the
body
as a flex container and ensure any children are center aligned on both the horizontal and vertical axis. - Create a
div
tag inside your body with an id attribute ofviewport
. - Style the
viewport
element (using an ID CSS selector) so it has the following properties:- a width of
640px
- a height of
256px
- a
position
ofrelative
- an
overflow-x
ofauto
- a
background-image
which should be thewater0.png
image.
- a width of
Make sure you understand what all of these style rules do before you move on!