Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Using background-attachment tag with text

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #209830
    aws0002
    Participant

    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.

    not sure if this link works http://codepen.io/aws0002/pen/gaXxWb#0

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.