Questions tagged [background-image]

The background-image CSS property sets one or more background images for an element.

Description

The CSS background-image property sets one or several background images for an element. The images are drawn on successive stacking context layers, with the first specified being drawn as if it is the closest to the user. The borders of the element are then drawn on top of them, and the background-color is drawn beneath them.

Value:          <url> | none | inherit
Initial:        none
Applies to:     all elements
Inherited:      no
Percentages:    N/A
Media:          visual
Computed value: absolute URI or none

Examples

#example { 
    background-image: url("images/darkpattern.png"); 
}

References

  1. background-image - W3C Specification
  2. background-image - MDN Link
6010 questions
9
votes
2 answers

Setting WPF control background image using styles?

I have a set of buttons inside a stack panel. I want them all to have a background image. How can i do it using styles? since i don't want to set manually the Background image for each button. Here is a code snippet:
aviv
  • 2,719
  • 7
  • 35
  • 48
9
votes
6 answers

Transparent JFrame background

Is it possible to make a JFrame that has a transparent background and draw an image on it, so only the image will be visible with no border or background?
user
  • 6,567
  • 18
  • 58
  • 85
9
votes
1 answer

android app widget dynamic background color with rounded corners android 2.3

I'm facing a problem with my implementation of changing the widget background color dynamically in android 2.3. I used this approach for my…
marilion91
  • 2,094
  • 1
  • 19
  • 28
9
votes
2 answers

How is this image effect created?

I have looked at this page for some time now. Amazing, really. But I can't tell how the background image effect that happens on scroll works. Have gone through the code found that they are using Jquery plus a number of scrolling plugins, but nothing…
Industrial
  • 41,400
  • 69
  • 194
  • 289
9
votes
9 answers

How to stretch a header across a web page background with CSS

http://www.stumbleupon.com/ http://www.mixx.com/ Both of these websites have a background header stretched across the page while the content is centered and is covering like say 80% of the width, and that also perfectly aligns with the rest of the…
TPR
  • 2,567
  • 10
  • 41
  • 65
9
votes
6 answers

Change background on button click, using CSS only?

Is it possible to change the background color on button click; of the entire document, using only CSS and HTML5? (e.g.: it's trivial in JavaScript)
A T
  • 13,008
  • 21
  • 97
  • 158
9
votes
3 answers

Bootstrap Responsive Images Scaling

Using Twitter Bootstrap I realize that by default it scales images responsively. This is great, but isn't always perfect. Say for example I have a 500x300 image on desktop, then it resizes for mobile that image is going to be really small and not…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
9
votes
4 answers

Background image using HTML5 to fit the page

I want to make one image the full background of a website! I know it sounds pretty simple, but it just got me crazy, it doesn't fit the page, this the last try I reached with! CSS : body { background:url('images/bg_img1.jpg') #A98436 no-repeat left…
0bserver07
  • 3,390
  • 1
  • 28
  • 56
9
votes
4 answers

Need Empty Div With Background Image To Force Height and Must Be Responsive

I need the following: emtpy div with no content background image set to the div the background image to be fluid/responsive on re-size I cannot set fixed dimensions on the div Everything I try fails to force the div open to support the size of…
john-marcello
  • 245
  • 3
  • 6
  • 16
9
votes
5 answers

Is it possible to make a responsive div with a background-image that maintains the ratio of the background-image like with an ?

Not a a native english speaker so there's probably a better way to shape the question...anyway: What I want to create is similar to the header here: http://thegreatdiscontent.com/adam-lisagor The header image is shown fully in all screensizes, and…
Jonathan
  • 697
  • 3
  • 13
  • 24
9
votes
3 answers

How can I override only the second image in a multiple background image declaration?

How can I utilize the cascade to override only the second image in a multiple background image declaration? I have specified a standard style for lis, with two background images (the kitten, and the fish on the right side). I've also specified a…
KatieK
  • 13,586
  • 17
  • 76
  • 90
9
votes
2 answers

set background Image to whole application in android

I want to set background image to my application in android. So my application already has a theme set in my manifest file like this Now this was implemented from the themes of…
sundeep
  • 601
  • 1
  • 8
  • 21
9
votes
2 answers

Android Application : Background Image over Background Color

I am new to android development and am developing my first android application. I have the background color of the View set in the layout's xml as follows. android:background="@+color/bgColor" Now, i have a full sized transparent background image…
Amyth
  • 32,527
  • 26
  • 93
  • 135
9
votes
4 answers

Button with BOTH color and background image

Is there any way to set the color and background image for a button? I want a green button with a transparent .png but it seems you can only have one or the other.
gatzkerob
  • 877
  • 2
  • 12
  • 32
8
votes
4 answers

A way to create random-noise background image (png) with javascript?

The new layout of YouTube added a background random-noise which I like very much, having seen almost exactely the same effect on other sites, so I plan to use the same technique in my webpage prototypes, or at least have this "trick" in my toolbox…
heltonbiker
  • 26,657
  • 28
  • 137
  • 252