AVeryNiceWeb

How to add background color to a division (DIV)

Cascade Style Sheets

How to add background color to a division (DIV)

Postby admin » Sat May 06, 2017 2:27 pm

Here we create a green background for a division called "success".

Paste the following HTML to the page where you want the background div to appear
Code: Select all
<div align="left" class="success">
<b>Text example</b><br>
<font size="3"><--- Enter more text --->></font></div>
</div>



Paste this CSS code at the top of the page befor the </head>:
Code: Select all
<style>
.success {
background-color: #ccffcc;
border : 2px solid #000;
border-radius: 15px;
border-color: #ccc;
padding: 10px;
}
</style>


In WordPress, you can simply enter the CSS part to your styles.css but without the <script>:
Code: Select all
.success {
background-color: #ccffcc;
border : 2px solid #000;
border-radius: 15px;
border-color: #ccc;
padding: 10px;
}
The AVNW Support Team
http://www.AVeryNiceWeb.com

We also have great domain names for your next website. Go through the list and make an offer now!

Shopping for a new website? See our design deals.

How much is your website worth? Get a free estimate.

And, if our post has provided you with great information, there are a few ways you can show your appreciation:
  1. Like us on Facebook
  2. Post a review.- Posting a good review about this site could help us provide improved support.

Thank You!
User avatar
admin
Site Admin
 
Posts: 481
Joined: Sun Jan 12, 2014 11:18 pm
Location: New York City

Return to CSS

Who is online

Users browsing this forum: No registered users and 0 guests

cron