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 i开发者_StackOverflowmage to be located in a bottom right corner of the webpage. How can I achieve this? (better with css method)
Thank You.
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
for more exactly positioning:
background-position: bottom 5px right 7px;
This should do it:
<style>
body {
background:url(bg.jpg) fixed no-repeat bottom right;
}
</style>
http://www.w3schools.com/cssref/pr_background-position.asp
Did you try something like:
body {background: url('[url to your image]') no-repeat right bottom;}
精彩评论