I’m designing a website in the style of a fixed background scrolling site and I want the text to also be fixed to the background, while the other elements scroll on top of it. I tried using “background-attachment: fixed;
within the div element of the text but it didn’t work.
I have found a solution but not sure if it’s the correct way of writing HTML/CSS. Basically what I have done is created a ‘div’ and made its position relative to its parent. I have then created the text within the
‘p’ tag and give it an ‘id’ I have then called this ‘id’ in to my css and made its position fixed.
This just seems really messy to me though and not sure if there is a better way or a more correct way of coding it.