cssbackground

How to position background image in bottom right corner? (CSS)


I have a 500x500 px image which is set as a background image on my website (as background-image of <body>) But I need this image to be located in a bottom right corner of the webpage. How can I achieve this? (better with css method)

Thank You.


Solution

  • VoilĂ :

    body {
       background-color: #000; /*Default bg, similar to the background's base color*/
       background-image: url("bg.png");
       background-position: right bottom; /*Positioning*/
       background-repeat: no-repeat; /*Prevent showing multiple background images*/
    }
    

    The background properties can be combined together, in one background property. See also: https://developer.mozilla.org/en/CSS/background-position