http://www.webmasterworld.com Welcome to WebmasterWorld Guest from 38.103.63.17
register, login, search, glossary, subscribe, help, library, PubCon, announcements , recent posts, unanswered posts
Accredited PayPal World Seller
Home / Forums Index / Browser Side World / CSS
Forum Library : Charter : Moderators: DrDoc & Robin reala & SuzyUK

CSS

  
How can I color a div and place text on top
Digmen1


#:3615055
 4:43 am on Mar. 31, 2008 (utc 0)

Hi Guys

I have set up a div that I am placing in a column.

I want to color the div and add text of a different color to it.

What code should I add to my style sheet to do this please ?

Kind Regards

Digby

Setek


#:3615083
 5:52 am on Mar. 31, 2008 (utc 0)

If it's a specific situation, you'd do best to add a class or an ID on the
div.

So, in the HTML it would say:

<div class="special"> ... </div>

And in the CSS:

div.special { background-color: #f0f; /* This property is for the background colour */
color: #0ff; /* This property is for the text colour */ }

That's it!

Digmen1


#:3615122
 7:45 am on Mar. 31, 2008 (utc 0)

Thanks !

Worked a treat !

Regards

Digby

 

Home / Forums Index / Browser Side World / CSS
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of WebmasterWorld Inc.
© WebmasterWorld Inc. / SearchEngineWorld 1996-2008 all rights reserved