2015-02-11 151 views
0

我一直在想,现在在一段时间里,人们在CSS中实现这种类型的背景是什么。这是一个图像背景,但图像似乎并不存在。你不能下载图像,不能拖动它。请参阅粉色时尚图片背景 here。我怎么能做到这一点?或者可以有人帮我使用功能名称?或者,也许是一个很好的链接,我可以学习或看到这方面的例子?我只是尝试使用谷歌搜索,但不知道它是什么。另一个例子是chineese新年背景Here。任何帮助,将不胜感激。CSS中的无图像背景图像

+0

这些只是标准的CSS背景图片。 'background:url(path/to/image.jpg)无重复中心;' – APAD1 2015-02-11 18:42:40

回答

1

它是一种background-image
新年:

.homepage-background-cny { 
    background: url("../../img/cny.jpg") no-repeat scroll right top transparent; 
} 

的Etsy:

#seasonal-hero { 
    background: url("//img0.etsystatic.com/site-assets/homepage-carousel/valentine-gift-hero-v3.jpg") repeat scroll center center #FEEEEF; 
    width: 100%; 
    height: 400px; 
    min-width: 1030px; 
    cursor: pointer; 
    position: relative; 
} 

背景图像通常不能被拖动的元素背景的来源可与检查员一起找到: enter image description here

JSFiddle Demo

div{ 
 
    height:300px; 
 
    background: url('http://lorempizza.com/1000/500'); 
 
}
<div>Background-Image</div>

+0

谢谢你。我认为这就是我正在寻找的。将研究它。 – brickleberry 2015-02-11 18:46:18

+0

@brickleberry没问题,如果这是你正在使用的答案,请[标记为已接受](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) – 2015-02-11 18:53:43

0

在CSS中使用背景图像规则:

背景图像:网址(“// img0.etsystatic.com/site-assets/homepage-carousel/valentine-gift-hero-v3.jpg “);

这是您链接使用的页面上的一个。

最佳, 迈克尔

1

他们只是CSS背景图片:

Demo

HTML

<div id="container"> 
    This is the content. 
</div> 

CSS

#container { 
    padding: 10px; 
    min-height: 600px; 
    width: 100%; 
    background: url(//img0.etsystatic.com/site-assets/homepage-carousel/valentine-gift-hero-v3.jpg) repeat-x; 
} 
+0

感谢@dev的帮助。 – brickleberry 2015-02-11 18:58:55