About 4,980,000 results
Open links in new tab
  1. html - How to change only body color? - Stack Overflow

    Im trying to change only my body color, i have a div with my content, and I want my body, only outside of main div to be gray. I've tried changing my body background color to grey and div to white:...

  2. how to set the background color of the whole page in css

    The body's size is dynamic, it is only as large as the size of its contents. In the css file you could use: * {background-color: black} // All elements now have a black background. or html {background-color: …

  3. How can I set an element's background-color in an HTML file?

    Sep 25, 2020 · 5 Is it possible to set an element's background-color without a CSS file? Just using an HTML file? In this case, I have a div I want to style. But I could want to style other elements in the …

  4. Confusion about the background color of body and html element

    Aug 7, 2023 · I set the background color of both body and html element background-color: rgb(35, 39, 47, 0.78);, but I got two color in the webpage when I previewing. How come?

  5. Applying a background to <html> and/or <body> - Stack Overflow

    Jun 8, 2012 · I found that if you apply a CSS background to body, it takes up the whole page (no matter what the actual height or width of body is). However, if you apply a CSS background to both html and …

  6. How do I change the background color with JavaScript?

    Oct 13, 2008 · Here are 2 ways to Change Background Color Using Javascript To change background color with javascript you can apply style.background or style.backgroundColor on the element you …

  7. How do I get `HTML > Body > Background-Color > Transparent`?

    HTML provides no means to specify a transparent background (and the means it has to specify backgrounds of any kind are obsolete and should not be used). You can do this in CSS.

  8. html - body background color not showing? - Stack Overflow

    Nov 8, 2014 · 5 html { height: 100%; } body { background-color:#cccccc; } This worked for me. Without setting the height in html, the background-color property of body wouldn't work at all.

  9. html - Make <body> fill entire screen? - Stack Overflow

    Without that border, the body will fill exactly 100% of the viewport, you can see that with a background color for example. The correct answer to that question was accepted 7 years ago is still valid.

  10. Changing the background color and width of the body element

    Feb 14, 2016 · The initial background-color for all elements is transparent. If the background-color of the html element is not specified (i.e., transparent) then, under the rules of CSS, the browser gives it the …