• Resolved voje

    (@voje)


    Hallo iedereen.

    ik zou graag alleen op mijn homepage een afbeelding als achtergrond willen en op de andere pagina een witte achtergrond. ik heb dit al geprobeert door

    .home body.custom-background {
      background-image: url(https://www.bypleun.nl/wp-content/uploads/2021/03/IMG_2720-scaled.jpg);
      background-position: left top;
      background-size: auto;
      background-repeat: no-repeat;
      background-attachment: scroll;
    }

    toe te voegen bijj extra css maar echter zie ik toch de afbeelding op iedere pagina.
    iemand tips voor mij?

    gr Peter

    • This topic was modified 3 years, 8 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • When I load the page, there’s a style with body.custom-background

    To show the background image only on your homepage, use body.home.custom-background.

    Thread Starter voje

    (@voje)

    Super bedankt.

    Ik heb deze code nu gebruikt.
    Maar hoe wordt de achtergrond van de rest van de pagina’s nu wit?

    White is the default background. When you remove the image that’s what remains.

    You can set the color for the entire site with this CSS. Just make sure that you place it above the existing rule. You want the image to override the color, but only on the homepage.

    body.custom-background {
      background: violet;
    }
    
    body.home.custom-background {
    ...
    Thread Starter voje

    (@voje)

    Thank you so much.
    It is perfect know.

    • This reply was modified 3 years, 8 months ago by voje.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Afbeelding als achtergrond alleen op homepage’ is closed to new replies.