WordPress.org

Ready to get started?Download WordPress

Forums

Adjust background witdh to browser width (6 posts)

  1. HawtCoffee
    Member
    Posted 2 years ago #

    Hey guys... im using Background Manager to stick the background image to bottom right corner, but i ALSO need to resize the image according to the browser WIDTH (keeping the aspect ratio).

    (that way the image would be stick to bottom right and left corners, since its gonna resize. it doesnt matter the height, since the image background is white and the website background also)

    fructum.com.br
    for an example (the background doesnt resize according to width yet, so the image usually is too big and covers the text that should be over the white part)

    Can anyone help me?

  2. vtxyzzy
    Member
    Posted 2 years ago #

    Try adding this to the end of style.css:

    body.custom-background { background-size: 100% auto; }
  3. Phil
    Member
    Posted 2 years ago #

    Only available in browsers that render CSS3, but:

    background: url(images/yourbgimage.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;

    Hope this helps! ;)

  4. vtxyzzy
    Member
    Posted 2 years ago #

    @Phil, will that work with the Background Manager sticking the BG to the bottom right?

  5. Phil
    Member
    Posted 2 years ago #

    Oh, I see. My option was doing it manually through style.css.

    You may be able to add my code to the plugin css file but I'd need a link to your site for a chance to find out where you should put it.

  6. HawtCoffee
    Member
    Posted 2 years ago #

    It worked vtxyzzy!! Thanks so much :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.