python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
Background Color CSS Properties and Example

Background Color CSS Properties and Example

The CSS Background Color Properties is used to change the background color of elements. The elements can be -
ü  html
ü  body
ü  footer
ü  H1,H2 and so on
ü  div
ü  P
ü  Your custom elements and so on

This property is supported most of browsers like IE, chrome, safari etc.

/* For HTML background color*/
html
    background-color: white;
}

/* For HTML body background*/
body {  
    background-color: white;
    background-image: url("background.gif");
    background-repeat: repeat-x;
}

/* For HTML body footer*/
footer
    background-color: black;
}

/* For HTML H1 tag background color*/
h1 {
    background-color: green;
}

/* For HTML div background color*/
div {
    background-color: lightblue;
}

/* For HTML page P background color*/
p {
    background-color: yellow;
}

/* For HTML div class selector background color*/
.MyPage-class {
    Background-color: white;
}

/* For HTML div ids selector background color*/
#MyPage-Ids {
  background-color: rgba(0, 0, 0, 0.8);
}


I hope you are enjoying with this post! Please share with you friends. Thank you!!
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions