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.

Step 1

In the Oxygen editor add a Section.

Horizontal Item Alignment: Center

Size & Spacing

Container Padding: 0 on all sides

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

You need to be logged in to view and post comments.
Not a member yet? Join here.
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: