Skip to content

Generate image as background url #271

@lcottingham

Description

@lcottingham

Please provide the following information and someone from @imgix/imgix-sdk-team will respond to your issue shortly.

Before you submit:

  • Please search through the existing issues to see if your question has already been discussed.

Question
Generate a URL from the path, but set it as a background image URL? This could be a parameter specifically determining src, srcset or background-image URL.

Alternatively, could a URL be easily generated directly in a component that can be fed into a variable for HTML consumption?

It is fairly common in UI design that an image will be dynamically set as a background image so that it can fit or cover the container's available space. Yes, there is the object fit property on an image, but this isn't too widely supported on older browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions