如何在右下角放置背景图片? (CSS)的 [英] How to position background image in bottom right corner? (CSS)

查看:567
本文介绍了如何在右下角放置背景图片? (CSS)的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有被设置为在我的网站背景图像(如背景图像<身体GT; ),一个500×500像素的图片,但我需要此图片是位于网页的右下角。我怎样才能做到这一点? (用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)

感谢你。

推荐答案

Voilla:

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*/
}

的背景属性可组合在一起,在一个背景属性。
参见:<一href=\"https://developer.mozilla.org/en/CSS/background-position\">https://developer.mozilla.org/en/CSS/background-position

这篇关于如何在右下角放置背景图片? (CSS)的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆