Monday, 17 August 2015

Images In Html

Html Images:

Example:



Image Syntax In Html:

<img> tag defines image in Html.
<img> tag remains empty and have no closing tag.
src attribute (source) specifies URL/web address of image.

Example:


Alt Attribute:

Alt attribute is used as alternate text for image that if the image can't be displayed.
Alt attribute gives alternative information for imagee if for some reason image can't be viewed(because of error in src attribute,of slow connection etc).
Browser will display alt text if it cannot find image.

Example:


alt attribute is essential,web is not able to display correctly without alt attribute.

Screen Readers In Html:

Screen reader is an software that is capable of reading what is displayed on screen.
screen readers help people who are blind or learning disable.
Screen readers can read alt attribute.

Width and Height - Image Size:

Style attribute is used to specify width and height of image.
Values are specified in pixels.

Example:


You can also use width and height attributes.Now here values are specified in pixel by default.

Example:


Style And Width And Height?

Use style attribute,it prevents styles sheet from changing original size of image.

Example:


Images in Another Folder:

Browser can be specified to more than one folder to find image for web page.
As it is common to store imge in sub-folder,then you should include the folder name in src attribute.

Example:


Images On Another Server:

Some of the websites usually store their image on servers of image.
In real you can access images in the whole world from any other web address.

Example:


Animated Images:

GIF standrad only allows animated pictures.

Example:


Using Image As Link:

If you want to use image as link,then nest <img> tag inside <a> tag.

Example:


Floating Image:

You can use CSS float property to let your image float.
Image can float to right or left of text.

Example:


Image Maps:

<map> tag defines image-map.

Example:


No comments:

Post a Comment