This members-only tutorial provides the steps to set up an inline image background using object-fit: cover in Oxygen.
In our earlier tutorial titled Responsive hero image with text overlay in Oxygen, the image was shown in its aspect ratio with the image stretched to fill the viewport width. This means depending on your image, it could be pretty tall. This is not ideal for a hero section.
In the other tutorial titled Inline Background Images in Oxygen, the image was shown using absolute positioning whereas in this tutorial, it is the hero section's content i.e., headline, subtitle and CTA button that are absolutely positioned.
The technique in this tutorial involves setting a fixed height for the Section, adding a 100% width and 100% height object-fit: cover image, and absolutely positioning the hero section's content Div.
Manual instructions below. 1-click Hydrogen code can be found at the end of the tutorial.