Questions tagged [background]

Background typically refers to the rendering behind a container element's contents - usually on a web page, Windows form or other UI presentation medium.

In CSS, the background property is a shorthand property for setting the individual background property values in a single place in the style sheet. This includes the image, color, tiling and position.

In Windows Presentation Foundation (WPF), the background attribute can be defined for any visual UI object. It should be noted that WPF applications use a background thread for handling rendering and repainting.

Desktop applications such as those written in .NET and Java may have colors or images used to fill the window of a particular frame or form.

For information about background threading, see the multithreading wiki.

14810 questions
157
votes
9 answers

How to center a (background) image within a div?

Is it possible to center a background image in a div? I have tried just about everything - but no success:
Lorem Ipsum ...
//CSS #doit { background-image: url(images/pic.png); background-repeat: none; text-align: center;…
oompahloompah
  • 9,087
  • 19
  • 62
  • 90
155
votes
16 answers

Run PHP Task Asynchronously

I work on a somewhat large web application, and the backend is mostly in PHP. There are several places in the code where I need to complete some task, but I don't want to make the user wait for the result. For example, when creating a new account, I…
davr
  • 18,877
  • 17
  • 76
  • 99
153
votes
11 answers

Remove background drawable programmatically in Android

I want to remove the background drawable @drawable/bg programmatically. Is there a way to do that? Currently, I have the following XML in my layout:
Emkey
  • 5,346
  • 8
  • 38
  • 55
149
votes
13 answers

CSS3 background image transition

I'm trying to make a "fade-in fade-out" effect using the CSS transition. But I can't get this to work with the background image... The CSS: .title a { display: block; width: 340px; height: 338px; color: black; background:…
Nick Zani
  • 1,491
  • 2
  • 10
  • 3
148
votes
3 answers

background:none vs background:transparent what is the difference?

Is there a difference between these two CSS properties: background: none; background: transparent; Are they both valid? Which one should be used and why?
web-tiki
  • 99,765
  • 32
  • 217
  • 249
148
votes
11 answers

How to programmatically round corners and set random background colors

I'd like to round the corners of a view and also change the color of the view based on the contents at runtime. TextView v = new TextView(context); v.setText(tagsList.get(i)); if(i%2 == 0){ v.setBackgroundColor(Color.RED); }else{ …
141
votes
13 answers

Android Studio Image Asset Launcher Icon Background Color

I have a .png logo for my app which doesn't have a background, when I add it to android studio as an Image Asset I am forced to have a background. The hex field doesn't accept 8 digit color codes, 6 digits only. Is there anyway to keep the…
HishamGarout
  • 1,743
  • 3
  • 11
  • 12
141
votes
13 answers

Preloading CSS Images

I have a hidden contact form which is deployed clicking on a button. Its fields are set as CSS background images, and they always appears a bit later than the div that have been toggled. I was using this snippet in the section, but with no…
Peanuts
  • 2,641
  • 6
  • 29
  • 34
138
votes
10 answers

How to stretch the background image to fill a div

I want to set a background image to different divs, but my problems are: The size of image is fixed(60px). Varying div's size How can I stretch the background-image to fill the whole background of the div? #div2{ …
Muhammad Usman
  • 10,426
  • 22
  • 72
  • 107
131
votes
1 answer

How can I put the current running linux process in background?

I have a command that uploads files using git to a remote server from the Linux shell and it will take many hours to finish. How can I put that running program in background? So that I can still work on shell and that process also gets completed?
Mirage
  • 30,868
  • 62
  • 166
  • 261
130
votes
5 answers

Setting the Vim background colors

When I try to change the background colors in .vimrc or directly in Vim using the command: set background=dark ... it doesn't affect my background at all. Neither does the light option. However, it looks okay when I run gvim. Is there a way to…
Maksim Vi.
  • 9,107
  • 12
  • 59
  • 85
128
votes
11 answers

Is there a way to use use text as the background with CSS?

I would like to use dynamic text as background of certain elements in my tag. Because of this, I can use images (dynamic text). How do I do it with just CSS or JavaScript?
chustar
  • 12,225
  • 24
  • 81
  • 119
124
votes
2 answers

iOS app icon with transparent background showing black background on device

I have added an icon to my app. It has rounded edges and no background. The problem is that when I run an app on my device (iPhone 5) the icon has a black background behind the edges as if it wasn't transparent. Any solutions?
Fengson
  • 4,751
  • 8
  • 37
  • 62
120
votes
9 answers

Android: keep Service running when app is killed

I want to keep a IntentService running in background even when the app is killed. And by "killed" I mean press home-button for a long time -> see all running apps -> swipe my app aside -> app killed OR press back-button for a long time -> app…
user2078872
  • 1,507
  • 3
  • 12
  • 16
114
votes
6 answers

sendMessage from extension background or popup to content script doesn't work

I know that question has been repeatedly asked in different ways, but I tried to go through all the answers (hopefully I didn't miss anyone) and none of them worked for me. Here is my extension's code: manifest: { "name": "test", "version":…
Subway
  • 5,286
  • 11
  • 48
  • 59