|
|
|
|
HTML Images
|
|
|
|
|
Most websites contain images making them a vital part of the web world. Being such important entities, especially for the website designers, it is extremely essential to understand the proper usage & embedding of these images into web pages using HTML.
A key consideration before you can embed an image into a web page is that, the image should necessarily exist in .gif, .jpg or .png format. These images can be created in an image editor like Adobe Photoshop & then saved in the appropriate format.
|
|
|
|
|
Once an image has been created, it needs to be embedded into the webpage. This embedding is done using the <img /> tag, that specifies the actual location of the image.
| |
|
Eg: <img src="butterfly.jpg" />
|
| |
In the above example,"Src" is the attribute used to represent the "source" of the image or more appropriately the location of the picture file. The source of the image can be defined in two basic ways:
Firstly you may define it in the form of a standard URL
| |
|
Eg: src=http://www.htmltag.org/pics/htmlT/butterfly.jpg
|
| |
Alternately, the image file can be uploaded or copied on your web server & accessed locally
| |
|
Eg: src="../butterfly.jpg"
|
| |
One important thing to remember while copying the URL is that, it cannot contain drive letters. Thus, a source definition like - src="D:\\www\web\pics\" is not considered valid. |
|
|
|
| |
|
|
| Use only hexadecimal #RGB values for colors. The behavior of named colors is browser-idiosyncratic and totally unpredictable. |
|
| |
|
|
|
|
| You can resize your images without a graphics program by changing the HEIGHT and WIDTH in your image tag. |
|
| |
|
|
|
| |
|
|
|
|
|
|