One of the most important elements of a web site is the background. It has a great effect on the appearance of your site and if you have a beautiful background design, the visitors will be attracted to your site and chances are, they will pay frequent visits to your page. It is an important factor that any
web designer considers because before a person can read the text content of the site, the first thing they will notice is the background.
A basic rule in setting a background is that its color should contrast with the text. Meaning if the background is dark, the text should be light and vice versa. Using CSS you can set the background color of your site and control how the background image is displayed. For now we will be focusing on
manipulation of color of your background to compliment with your text. There are many colors available and you can control the individual values of the RGB to enhance its hue.
h4 { background-color: white; }
p { background-color: #1078E1; }
ul { background-color: rgb( 149, 206, 145); }
As seen above, you can use the color's name, its hexadecimal value or the RGB range. Of course you are not expected to memorize the name,
hexadecimal value, and RGB of every color so browse through the net find them out. Here's an example of a colored background:
<! - CODE SAMPLE - !>
<html>
<head>
<style type="text/css">
body {background-color: white}
h1 {background-color: #00ff00}
h2 {background-color: blue}
p {background-color: rgb(250,50,25)}
</style>
</head>
<body>
<h1>header with green background</h1>
<h2>header with blue background</h2>
<p>paragraph with red background</p>
</body>
</html>
<! - End Sample - !>
Cascading Style Sheets Comments
Wed, 18.10.2006 15:40
I have read the book, its a top reference materials. But I hope there are more sample codes included in such published [...]
Wed, 18.10.2006 15:39
Good book. I might buy a copy for myself to help me with my CSS tutorials.
Sat, 07.10.2006 12:20
I don't think assigning multiple styles on the pages of your internet site is good. This is because IE just might not [...]
Sat, 07.10.2006 12:20
I think this trick should also give you more room to tweak the visual aspect of your internet site. In a more [...]
Sun, 24.09.2006 17:12
I think most of the developers of the leading internet site browsers don't have a damn idea what the people need in [...]
Sun, 24.09.2006 17:12
I think most of the developers of the leading internet site browsers don't have a damn idea what the people need in [...]
Sun, 24.09.2006 16:38
I just don't know why a lot of people prefer good visual techniques applied on the pages of the internet sites they view [...]
Sun, 24.09.2006 16:34
I think you should use Mozilla or anything else other than IE. IE just seems to have more and more problems each time [...]
Sun, 24.09.2006 16:33
I think IE has a lot of problems when it comes to viewing CSS styled pages. Even with the releases they have made on [...]
Fri, 22.09.2006 13:29
Now I can use CSS width functions on the pages of my internet site! Back then, I just avoided CSS styled pages on my [...]
Fri, 22.09.2006 13:28
I have encountered the same problem in using CSS width functions on my internet site, but I just seemed to avoid using [...]
Wed, 20.09.2006 15:36
Since I think you wouldn't want to hack your way through the design of your CSS styled documents, I think you should [...]
Wed, 20.09.2006 15:36
I think there are lots of problems with IE and CSS styled web pages. With this, I think you're all better off with [...]
Sat, 16.09.2006 14:47
But I don't think they're releasing any patches yet! I don't know why it's taking them so long to produce a patch, but [...]
Sat, 16.09.2006 14:47
I think this problem can be solved with just a well needed patch from the Microsoft team.