Style Sheets
  Home arrow Style Sheets arrow Page 2 - CSS: Backgrounds
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

CSS: Backgrounds
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-03-03

    Table of Contents:
  • CSS: Backgrounds
  • How to Set the Background Color
  • Working with Background Images
  • Positioning the Background Image
  • Text in CSS

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    Iron Speed
     
    ADVERTISEMENT

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    CSS: Backgrounds - How to Set the Background Color


    (Page 2 of 5 )

    You can set the background color of an object using the background-color property. Here is some code to show you how to do so for several elements,  using colornames, colorcodes, and hexvalues:

    <html>

    <head>

    <style type="text/css">

    body {background-color: white}

    h1 {background-color: #FF8C00}

    h2 {background-color: yellow}

    h3 {background-color: green}

    h4 {background-color: blue}

    h5 {background-color: indigo}

    h6 {background-color: violet}

    p {background-color: rgb(208,0,0)}

    pre {background-color: transparent}

    </style>

    </head>

    <body>

    <p>Look a rainbow!</p>

    <h1>Death to Rainbow Bright</h1>

    <h2>Death to Rainbow Bright</h2>

    <h3>Death to Rainbow Bright</h3>

    <h4>Death to Rainbow Bright</h4>

    <h5>Death to Rainbow Bright</h5>

    <h6>Death to Rainbow Bright</h6>

    <pre> Look! Transparency!</pre>

    </body>

    </html>

    This would result in:




    More Style Sheets Articles
    More By James Payne


       · Thanks for stopping by to read my article on CSS Backgrounds. Here we discuss such...
     

    STYLE SHEETS ARTICLES

    - Creating Gradients for Individual Containers...
    - Creating Gradients for Web Page Headers with...
    - SEO Scrolling Frames Problem Solved
    - Building Cross-Browser Background Effects wi...
    - CSS: Pseudo
    - Using PNG Images to Build Background Effects
    - CSS: Continuing the Clarification of CSS Cla...
    - CSS: Top Secret Classification
    - CSS: Dimensions
    - CSS: Margins and Padding
    - CSS: Crossing the Border
    - CSS: Text, Fonts, and Tables
    - CSS: Working with Text
    - CSS: Backgrounds
    - CSS for the Newbie


    Iron Speed





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway