Images
Images can add a lot to your page. They can make it look more appealing but they can also convey information much better than words in many circumstances. Including images is not too difficult but there are a few little tricks to doing it well. In this section we’ll look at both.
If you just want to learn about the img tag feel free to read just the first bit but if you want to discover more then I encourage you to keep on reading.
Displaying an Image:
An image is displayed using an img tag. It stands for image. Within the tag there are several attributes we may include but there are two which are fairly important. he src attribute stands for source. It is the location of the image which is to be included. It is a standard URL and similar to links may be absolute or relative. The alt attribute stands for Alternate Text and is a simple description of what the image is. Normally you won’t see the description but it has it’s uses.
- Screen readers (as used by people with vision impairment for example) will read the alt text as opposed to displaying the image.
- If there is an error loading the image for some reason then the alt text will be displayed instead.
- Search engines will use the alt text to help index images. Writing useful alt text can help give you a boost (if somewhat minor) in their rankings.
You may be wondering why we don’t use the title attribute for the description of the image. We can add the title attribute and it will display on hover but the title is generally used to add ancilliary information as opposed to a description. For this reason we have the alt attribute which is specifically for adding a description.
[
].
Colors
Colors are very important to give a good look and feel to your website. You can specify colors on page level using <body> tag or you can set colors for individual tags using bgcolor attribute. The <body> tag has following attributes which can be used to set different colors
- bgcolor − sets a color for the background of the page.
- text − sets a color for the body text.
- alink − sets a color for active links or selected links.
- link − sets a color for linked text.
- vlink − sets a color for visited links − that is, for linked text that you have already clicked on.
HTML Color Coding Methods:
There are following three different methods to set colors in your web page
- Color names − You can specify color names directly like green, blue or red.
- Hex codes − A six-digit code representing the amount of red, green, and blue that makes up the color.
- Color decimal or percentage values − This value is specified using the rgb( ) property.
[
].
Text
HTML stands for HyperText Markup Language. It is used to design web pages using a markup language. HTML is the combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within tag which defines the structure of web pages. This language is used to annotate (make notes for the computer) text so that a machine can understand it and manipulate text accordingly. Most markup languages (e.g. HTML) are human-readable. The language uses tags to define what manipulation has to be done on the text.
HTML is a markup language used by the browser to manipulate text, images, and other content, in order to display it in the required format.