Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Avada › Forums › Community Forum › How to set a fixed height column
Tagged: css, images, background-image, contain, cover
I have a problem, in the container I have 2 columns (1/2).
How can I set the height to use an image in the backgrownd and it won’t be cropped?
Each column has a title element for text.
Thank you
Hi,
I don’t think fixing the height will stop your background image from being cropped.
If you are using a background image and you don’t want it ever to be cropped, then you need to specify the background-size: contain
rather than background-size: cover
. But, this has implications.
See this CodePen to compare between contain and cover.
See MDN for the proper background-size
syntax.