Skip to Content
avatar image
Former Member

How to use the background-size: cover; style for generic tile background image

Hi,

I have a generic title with background image, currently the image is not displayed within the tile boundaries and displayed perfectly when change element style property to background-size : cover.

How can we use CSS over here to adjust the image in the tile.

Regards,

Narayan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 09, 2017 at 10:23 AM

    Hey,

    You started by saying "title" I'm guessing you meant tile.

    • Are you using the property backgroundImage ?
    • Can you resize the original image so to fit the tile in the way you want to?
    • How do you know that 'background-size: cover' works?
    • Why can't you give the tile a unique id and use css to adjust it?
    • Can you create a jsfiddle or any type of a sandbox to try and help you with? Share your code with mock data in it?
    Add comment
    10|10000 characters needed characters exceeded