Friday, October 26, 2012

images: HTML

Images are so easy. There are all sorts of things you can do with images in HTML. The basic code is:
<img src="image url"> 
The most popular code customizes what you see when the image can't load, or images are disabled in the browser. Here it is:

<img src="image url" alt="tag">

tag is the text that's displayed when the image doesn't load or images are disabled. Sometimes search engines use it to define image search. 

Defining the width and hight
If you want to change the size of the image, you may tell the browser how to size it:

<img src="image URL" alt="tag" width="400" height="400">

Customizing the border
You can create a border around images with a simple code. This is not in HTML 5 so I'll post about images in CSS later. 

<img src="image URL" alt="tag" border="5">

or you could use this code:

<img src="image URL" alt="tag" width="400" height="400" border="5">

lots of HTML image attributes are deprecated in HTML 5.  Luckily, CSS provides these and so much more. In the future, use CSS for your image effects. 


No comments:

Post a Comment

Feel free to comment. Keep it nice, polite and on topic. You may link to a site if it contains content relates to the content of whatever post you are commenting on. You may link to a site that only uses, for example, HTML5 video. Remember, on topic!