Html tute 5: page backgrounds
July 27th 2006 01:05
Today I'm going to deal with website backgrounds and at this point I am going to make a warning. This basic html faq is aiming to teach you how to put up a very basic website. However, that means it ignores some of the recommended ways to do things for the sake of simplicity. In the intermediate section of these tutes style sheets are used, and they are better then the following background tags.
Unlike previous lessons we wont be creating a new website this week. Instead, I suggest you go back to previous weeks and play with their background colours or add background pictures.
Background Colour
The background tags are defined within the body and take two main forms. The first of these are colour, which is written as follows:
<body bgcolor=colourdesignator>
The colour designated can either be a colour name, in which case it is enclosed in quotation marks (ie, <body bgcolor="red">
, an RGB – or Red, Green, Blue value, which is written as follows:
<body bgcolor="rgb(255,0,0)">
The first number in the bracket recommends the amount of red, the second the amount of green and the third the amount of blue. So blue would be (0,0,255) and white, the combination of all colours, would be (255,255,255).
Finally, these colours can be defined as hexidecimal values, which take the following form:
<body bgcolor="#FF0000">
if you want to know why it takes that form then either look into hexidecimal or drop me a comment and I'll explain it.
Body background
To add an image as the background of a page you use the following code:
<body background="imagesource">
As with the images discussed last week this can either be the URL of a picture of a picture in the local directory, in which case you just write the image name. So:
<body background="http://upload.wikimedia.org/wikipedia/en/7/77/Oscar.jpg">
or
<body background="picture1.jpg">
And that's it for this week. Next week we discuss frames and their associated problems.
Adam
Unlike previous lessons we wont be creating a new website this week. Instead, I suggest you go back to previous weeks and play with their background colours or add background pictures.
Background Colour
The background tags are defined within the body and take two main forms. The first of these are colour, which is written as follows:
<body bgcolor=colourdesignator>
The colour designated can either be a colour name, in which case it is enclosed in quotation marks (ie, <body bgcolor="red">
<body bgcolor="rgb(255,0,0)">
The first number in the bracket recommends the amount of red, the second the amount of green and the third the amount of blue. So blue would be (0,0,255) and white, the combination of all colours, would be (255,255,255).
Finally, these colours can be defined as hexidecimal values, which take the following form:
<body bgcolor="#FF0000">
if you want to know why it takes that form then either look into hexidecimal or drop me a comment and I'll explain it.
Body background
To add an image as the background of a page you use the following code:
<body background="imagesource">
As with the images discussed last week this can either be the URL of a picture of a picture in the local directory, in which case you just write the image name. So:
<body background="http://upload.wikimedia.org/wikipedia/en/7/77/Oscar.jpg">
or
<body background="picture1.jpg">
And that's it for this week. Next week we discuss frames and their associated problems.
Adam
| 118 |
| Vote |
Shared on
Subscribe to this blog







