This Multi-Part series will teach you the Beginnings of HTML. HTML Has many applications, from creating webpages, to .hta files to even formatting blog posts how you want.
These lessons are simple, easy to follow, and critically will remain relevant going forward. You can find the previous parts of the series:
These lessons are simple, easy to follow, and critically will remain relevant going forward. You can find the previous parts of the series:
3.1 Default Colors
HTML allows you to set the color of just about every element. Objects that allow you to do this include:
· Backgrounds
· Text
· Borders
· Tables
· The Document Itself
adding color is accomplished using the color attribute in tags. The default colors for the page however go in the body tag and have their own special attribute. Colors can defignd using either names or hex codes. Values for both of these can be found in the appendix at the back.
HTML allows you to set the color of just about every element. Objects that allow you to do this include:
· Backgrounds
· Text
· Borders
· Tables
· The Document Itself
adding color is accomplished using the color attribute in tags. The default colors for the page however go in the body tag and have their own special attribute. Colors can defignd using either names or hex codes. Values for both of these can be found in the appendix at the back.
It should be noted that most webpages use cascading style sheets to control colour.
Default Link Color
In html there are three types of links. Links (link) which havent been visited, Active links (Alink) which are being loaded, and Visited links (Vlink) which have been visited. All three can have different colors. The colors are set in the body tag with the value equal to the color code. For example
<BODY LINK="#008000" VLINK="#FF0000" ALINK="blue">
The caracters in the quotes are the color codes set in hexidecmal. This allows you to create any color you wish just by changeing the charachters. Note that the pound sign ( # ) is allways required. Also the ALINK is set using normal words as an alternative to the codes. This method is easier but offers less control then the hex code method
Text Color
HTML also allows the default text color to be set in the body tag. This is done the same way as the links only the attribute is TEXT . the example below shows how it is set
<BODY TEXT="#000000">
Background Color
HTML also allows the default background color to be set in the body tag. This is done the same way as the links only the attribute is BGCOLOR . the example below shows how it is set
<BODY BGCOLOR="white">
3.2 Object Color
Any object that can have a color can be set using the COLOR attribute. The COLOR attribute can be added to the font tag, horizontal rules, headings, and many other objects. It should be noted that a tag can have more than one attribute assigned to it. We will demonstrate its placement in the font tag, as that is where it is most commonly used
<FONT SIZE="-2" COLOR="white">
the color attribute is added like any other attribute to any tag
3.3 Inserting Graphics In the Document
To insert a graphic in a web page you use the the <IMG SRC> Tag. There is no closing tag for this tag. The tag also lets you set the graphic size and alignment. The basic tag would appear as:
<IMG SRC="filename.gif">
The Height and Width atributes can be used to set the size of an image, either larger or smaller. These are set by setting the attribute to the number of pixals you want that dimentions to appear. So a tag that sets the height to 120 and width to 60 would look like:
<IMG SRC="filename.gif" HEIGHT="120" WIDTH="60">
The align attribute allows you to set the location of the picture to text and other objects. Possible properties this attribute can accept include:
· Top
· Bottom
· Middle
· Left
· Right
· Center
An image aligned to the left would appear as:
<IMG SRC="filename.gif" HEIGHT="120" WIDTH="60" Align="Left">
Images as links
Images can also be used instead of text for a link. This is done by placeing the image tag where the text would normaly appear. To identify the image as a link a blue border will appear around it. The code would look like:
<A HREF="link.html"><IMG SRC="filename.gif"></A>
To remove the border around the image that identifies it as a link, set the border atribute to 0 in the image tag. The link above without a border would look like:
<A HREF="link.html"><IMG SRC="filename.gif" BORDER="0"></A>
As a Background
Html also allows you to set images as a background for your page. For example if the topic of the page is spiders then you can set the background of the page to be a spider web. Backgrounds can be set for a number of objects includeing
· tables (covered latter in the book)
· the document itself
To set the background of a document you add the background attribute to the body tag with its value set to the filename:
<BODY BACKGROUND="filename.ext">
Default Link Color
In html there are three types of links. Links (link) which havent been visited, Active links (Alink) which are being loaded, and Visited links (Vlink) which have been visited. All three can have different colors. The colors are set in the body tag with the value equal to the color code. For example
<BODY LINK="#008000" VLINK="#FF0000" ALINK="blue">
The caracters in the quotes are the color codes set in hexidecmal. This allows you to create any color you wish just by changeing the charachters. Note that the pound sign ( # ) is allways required. Also the ALINK is set using normal words as an alternative to the codes. This method is easier but offers less control then the hex code method
Text Color
HTML also allows the default text color to be set in the body tag. This is done the same way as the links only the attribute is TEXT . the example below shows how it is set
<BODY TEXT="#000000">
Background Color
HTML also allows the default background color to be set in the body tag. This is done the same way as the links only the attribute is BGCOLOR . the example below shows how it is set
<BODY BGCOLOR="white">
3.2 Object Color
Any object that can have a color can be set using the COLOR attribute. The COLOR attribute can be added to the font tag, horizontal rules, headings, and many other objects. It should be noted that a tag can have more than one attribute assigned to it. We will demonstrate its placement in the font tag, as that is where it is most commonly used
<FONT SIZE="-2" COLOR="white">
the color attribute is added like any other attribute to any tag
3.3 Inserting Graphics In the Document
To insert a graphic in a web page you use the the <IMG SRC> Tag. There is no closing tag for this tag. The tag also lets you set the graphic size and alignment. The basic tag would appear as:
<IMG SRC="filename.gif">
The Height and Width atributes can be used to set the size of an image, either larger or smaller. These are set by setting the attribute to the number of pixals you want that dimentions to appear. So a tag that sets the height to 120 and width to 60 would look like:
<IMG SRC="filename.gif" HEIGHT="120" WIDTH="60">
The align attribute allows you to set the location of the picture to text and other objects. Possible properties this attribute can accept include:
· Top
· Bottom
· Middle
· Left
· Right
· Center
An image aligned to the left would appear as:
<IMG SRC="filename.gif" HEIGHT="120" WIDTH="60" Align="Left">
Images as links
Images can also be used instead of text for a link. This is done by placeing the image tag where the text would normaly appear. To identify the image as a link a blue border will appear around it. The code would look like:
<A HREF="link.html"><IMG SRC="filename.gif"></A>
To remove the border around the image that identifies it as a link, set the border atribute to 0 in the image tag. The link above without a border would look like:
<A HREF="link.html"><IMG SRC="filename.gif" BORDER="0"></A>
As a Background
Html also allows you to set images as a background for your page. For example if the topic of the page is spiders then you can set the background of the page to be a spider web. Backgrounds can be set for a number of objects includeing
· tables (covered latter in the book)
· the document itself
To set the background of a document you add the background attribute to the body tag with its value set to the filename:
<BODY BACKGROUND="filename.ext">
No comments:
Post a Comment