Fitting custom background to screen?

  • Author
    Posts
  • #1264332

    Hello,

    I am attempting to get my custom background image to fit to any screen in CSS but can’t quite figure it out.

    Any help would be greatly appreciated!

    The blog I need help with is somethingaboutheaddresses.wordpress.com.

    #1264441

    Add this to your custom CSS.

    body.custom-background {
    background-size: contain;
    }
    #1264451

    Thanks!

    When I resize my window, the image conforms somewhat but now the text doesn’t. I’ll keep messing with it.

    #1264481

    The text isn’t technically within the “body” and “body boundaries are the edges of the browser window. All page elements (text, etc.) are within the “page” div and the children/grandchild/etc., divs, which have dimension independent (sort of) of the browser window. That means the two resize differently.

The topic ‘Fitting custom background to screen?’ is closed to new replies.