Home  >  Article  >  Web Front-end  >  background 图片设置问题_html/css_WEB-ITnose

background 图片设置问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:40:581469browse

css url

background:url(../images/gif.jpg) ;
这个显示没有认为错误,就不说了。
background:url(../images/gif.jpg) no-repeat right bottom;
这个显示不出来图片,我也知道因为图片显示在右下角,可能在可视区域看不到而已,
我想问的是,如果是可视区域看不到应该会有滑条的出现啊,也没有,给人的感觉似乎这个图片根本无法出现。。。。。

回复讨论(解决方案)

代码有问题,你是设置的是背景图片,而不是真实的图片,所以没人会知道网站最长会有多长,
背景图片只是你网站大小有多少,则显示多少。

可能的问题
1.路径不对
2.背景图片太大了,没有显示全,只看到背景图片的一部分,可以通过调节background-position的top和left来设置。

背景图片的定位 并不能决定是否有滚动条,
滚动条的出现时取决于当前容器overflow属性

要设置宽度和高度 或者给个默认的宽度和高度
background:url(../images/gif.jpg) no-repeat right bottom 100px 100px;

要设置宽度和高度 或者给个默认的宽度和高度
background:url(../images/gif.jpg) no-repeat right bottom 100px 100px;
试着设置一下。

楼上五楼的正解。。。。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn