FOLLOW US ON TWITTER



FOLLOW US



img/blogimg/css3.jpg


@coder 502

What is CSS3 background-color property?


2021-11-16 11:19 · 3 min read

The background-color property specifies the background color of an HTML element. background-color is a very useful CSS Property for creating attractive websites.

CSS3 Background-color Property

You can change the background of your website using the CSS background-color property.

{background-color :  red;}
                   


property            value


 

Example

Here is a simple example of background-color property
Here we are changing the background-color of a <div> Tag.
On running the code you can see the purple background on <div> Tag.

<!DOCTYPE html>
<html>
<head>
<title>Button</title>
</head>
<body>
<div style="background-color:purple;
padding:30px;color:white">
TDB Tutorials
</div>
</body>
</html>

 

Examples

Black background-color

  • rgb(0,0,0) value use for black color.
  • Red background-color
  • rgb(255,0,0) value use for Red color.
  • Green background-color
  • #008000 value use for Green color.
  • Blue background-color
  • #0000ff value use for Blue color.
<!DOCTYPE html>
<html>
<head>
<style>
.tdb-school{color:rgb(255,255,255);padding:10px 35px;
border:none;border-radius:5px}
.black{background-color:rgb(0,0,0)}
.red{background-color:rgb(255,0,0)}
.green{background-color:#008000}
.blue{background-color:#0000ff}
</style>
</head>
<!--Body-->
<body>
<button type="submit" class="black tdb-school">
Press</button>
<button type="submit" class="red tdb-school">
Press</button>
<button type="submit" class="green tdb-school">
Press</button>
<button type="submit" class="blue tdb-school">
Press</button>
</body>
</html>

 

TAGS:






POST COMMENTS
No Comment

Please login to post comment




POPULAR POSTS

best free web hosting services...
what is new in miui 11?...
free website ssl security using cloudfla...
do you want to make money online?...
CSS3 @IMPORT RULES...
What is HTML Anchor Tag and Hyperlinks?...
How to host a web page in 10 minutes....
CSS3 RESPONSIVE UI...
Tables HTML...
CSS3 FUNCTIONS...
How to use CSS3 Overflow Property?...
CSS3 FILTERS...


RECENT COMMENTS

2022-03-05 11:05
By coder on XAMPP - MySQL shutdown unexpectedly | How to fix MySQL crash unexpectedly
2021-10-12 12:34
By abnongoke on do you want to make money online?
2021-10-12 12:34
By abnongoke on how to get a free website domain name?
2021-10-12 12:34
By solar panel for shed on what is new in miui 11?
2021-10-12 12:34
By solar panel for shed on best free web hosting services
2021-10-12 12:34
By amos tanui on free website ssl security using cloudflare


SOCIAL SHARE



FOLLOW US ON TWITTER



FOLLOW US ON FACEBOOK



FOLLOW US







Recent Blogs



Contact Us

Subscribe Our News-Letter



Kashipur, 244713
Uttarakhand, India



© www.prodevskill.com 2023. All Rights Reserved. Powered by Pro Developer