Html images

516 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
516
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Html images

  1. 1. HTMLIMAGES
  2. 2. Image Tag and SRC Attribute  <img> defines an html image  src - stands for source - attribute value contains url of image syntax: <img src="url">
  3. 3. Alt Attribute >>> used to define an “alternate text” in cases where the image fails to load >>> attribute value is author-defined e.g. <img src="car.jpg" alt="my car">
  4. 4. Width and Height Attributes >>> allows you to specify the display width and display height of your image syntax: <img src=“url” width=“n” height=“n”> *value can either be in pixels or percentages
  5. 5. Aligning Images >>> use the align attribute to align an image within text >>> values are "top", "bottom", "middle" e.g. <img src="url" align="top">
  6. 6. Floating Images >>> to let an image float either to the right or to the left of a paragraph, use the align attribute as well >>> values are "right" and "left"
  7. 7. Floating Images e.g. <p> <img src="url" align="left"> This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. </p>
  8. 8. Hspace and Vspace Attributes  hspace, vspace attributes are used to add space around the image <img src="url" hspace="n" vspace="n"> hspace: to add space on both the right and left sides of the image vsapce: top and bottom of the image
  9. 9. Background Attribute >>> used to insert a background >>>use with the <body>, <table>, <tr> or <td> tags e.g. <body background="url">
  10. 10. Image Links >>> the anchor tag can turn an image into a link syntax: <a href="url"><img src="url"></a>

×