Saturday 1 April 2017

Image (IMG) and FONT element in HTML

Image (IMG) element - 
                                       This is an empty element specified by <IMG> tag. It is used to insert an image in a web page.

Syntax: 
<IMG SRC="location" BORDER = "border" ALIGN = "alignment" HEIGHT = "height" WIDTH = "width">

Attributes of  image(img) element:-

SRC: SRC tells the browser where the source for the image is, that is, the path and name of the image to be inserted. If no path is given, the source is assumed to be the current folder - the folder of the web page. Most browsers only support a few image formats or file types. They are GIF and JPEG.


Syntax: 
 SRC = "path/filename"

BORDER:-BORDER is used to place (or eliminate) a border of specified width around the image. Border widths are measured in pixels. The BORDER="0" means that we want no border.

Syntax: 
BORDER = "n" 
 where n is a natural number.

ALIGN:-ALIGN specifies the alignment of the image according to surrounding contents of the page. Alignment can be middle, top, bottom, left, right. Bottom is the default alignment!

Syntax: 
ALIGN = "alignment"

WIDTH:-WIDTH specifies the horizontal width of the image. Width is specified in number of pixels or as the percentage of page width.

Syntax: 
WIDTH = "n%" 
 where n is a natural number

HEIGHT:-HEIGHT specifies the height of the image. Height is specified in number of pixels or as the percentage of page height.


Syntax: 
HEIGHT = "n" 
 where n is a natural number

FONT element -
                           It is a container element started by <FONT> tag and ended by </FONT> tag. The FONT element is used to add style, size, and color to the text. We use the size, color, and face attributes to customize our fonts.

Syntax: 
                   <FONT FACE="font name" SIZE = n COLOR = "color" > 
...
...
</FONT>
Attributes of FONT element:-

FACE:-FACE is used to specify the name of the font. A list of font names separated by commas can be specified. If the first font is available on the system, it will be used. Otherwise the second will be tried, and so on. If none is available, the default font will be used.

Syntax:
FACE = "font name"

SIZE:-The SIZE attribute is used to specify the font size between 1 and 7 (7 is the largest).

Syntax:
 SIZE = "n" (n is a natural number between 1 and 7) 

COLOR:-Sets th color of the text. The color can be set by giving the name of the color or its hexadecimal value.
Syntax:
COLOR = "color"

Web Page designed using font and img tag:-


Browser View:-




2 comments: