Which is better background fixed on a section : background attachment fixed (CSS) or img tag with position fixed?

I want to know how are you doing a background fixed on a section element. I've tried this both options, but I want to see pros and cons and which one is better

13th Aug 2020, 4:02 AM
Héctor Mtz
Héctor Mtz - avatar
1 Answer
Image tag fixed is a different thing, if you fix an image, being a different element or say section, it will stay their and other containers will flow beneath it. But when using background css property on a container, is generally used when you want an image as a background where you can add items on to it, without changing the position of the child elements.. and the container stays in the stack it doesn't come out of the flow. So when we use background attachement as fixed property, then the content scrolls and the background stays their as fixed
13th Aug 2020, 4:50 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar