Background to cover full page?


  • Brian
    Newbie 37 points
    March 5, 2019 at 4:16 pm

    Hello,

    I added the following to my stylesheet in my child theme on 8.9.6 which I thought would stretch the background to cover the whole page:

    body { background-size: cover; }

    It doesn’t seem to make much difference and we I access the site from a higher resolution monitor, the BG image doesn’t scale and it displays the BG color in areas that the image doesn’t cover.

    Any way to fix this?

    Thanks!

  • JamesD
    JamesD
    Super Guru 1,722 points
    March 6, 2019 at 12:40 am

    Hello Brian,
    Try adding the !important rule immediately after “cover“):
    body { background-size: cover !important; }

    If for some reason it doesn’t work then please provide a URL.


  • Brian
    Newbie 37 points
    March 6, 2019 at 12:56 am

    Hi James,

    AWESOME! That worked. Many thanks!!!!

  • JamesD
    JamesD
    Super Guru 1,722 points
    March 6, 2019 at 1:13 am

    You’re welcome, glad it helped.

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    March 11, 2019 at 2:08 am

    Thanks James.

Viewing 5 posts - 1 through 5 (of 5 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes