I just got stuck with a simple problem to figure it out. What is the default background color of HTML elements? Is it white or transparent?
Asked
Active
Viewed 1.9k times
17
-
1Related: [background:none vs background:transparent](http://stackoverflow.com/questions/20784292/backgroundnone-vs-backgroundtransparent) – web-tiki Feb 04 '16 at 16:31
-
not sure why you'd need to ask this on stackoverflow rather then adding a div with a background colour that has child divs (without a background colour), then previewing the result in a browser? – Aaron Feb 04 '16 at 16:36
-
@Aaron I asked it because I want to have the experts answers as I was writing an important paper. I was somehow sure about transparent but still want to confirm it. – Maihan Nijat Feb 04 '16 at 16:59
2 Answers
22
The default background color is transparent.
See here: https://developer.mozilla.org/en/docs/Web/CSS/background-color

Sebastian Simon
- 18,263
- 7
- 55
- 75

developthewebz
- 1,827
- 3
- 17
- 43
-
Is there a setting such as 'default' or you must use `transparent`? – Shimmy Weitzhandler May 13 '19 at 07:02
6
The standard background color is transparent as can be seen here.
The background-color property sets the background color of an element.
The background of an element is the total size of the element, including padding and border (but not the margin).
Default Value: Transparent

Community
- 1
- 1

DamianBreda
- 112
- 5