| Image Syntax | <img src="url" alt="some_text"style="width:width; height:height;"> | The <img> tag is empty, it contains attributes only, and does not have a closing tag. | |
| The alt attribute provides an alternate text for an image, if the user for some reason cannot view it | |||
| The alt attribute is required. A web page will not validate correctly without it. | |||
| You can use the style attribute to specify the width and height of an image. | |||
| <img src="html5.gif" alt="HTML5 Icon"style="width:128px; height:128px;"> | The values are specified in pixels (use px after the value) | ||
| <img src="html5.gif" alt="HTML5 Icon" width="128" height="128"> | Alternatively, you can use the width and height attributes | ||
| The values are specified in pixels by default | |||
| we suggest using the style attribute. It prevents internal or external styles sheets from changing the original size of images | |||
| Image Floating | <img src="smiley.gif" alt="Smiley face" style="float:right; width:42px; height:42px;"> | The image will float to the right of the text | |
| <img src="smiley.gif" alt="Smiley face" style="float:left; width:42px; height:42px;"> | The image will float to the left of the text | ||