Displaying image on a web has become a current needs for almost every websites. Images is often use as a banner, button, picture-related article, advertisement, documentation, tutorial, and many more. But, image can also reduce our internet speed, because of it’s relatively big size while loading. What should we do to make a faster image loading?

Here are some tips to make a faster image loading in your sites :

Read more »

For some web-designer, correct HTML tag in every html file is a must. The HTML tag in every web page should follow the W3C, so it can be mentioned as a valid HTML page. But sometimes, although some image can be seen as good as we want, actually we (and other web-designer) did a very fatal mistake according to W3C standard. How come?

Image can be shown in every web page with a very simple HTML tag. For example, we want to display an image “example.jpg” from our hosting directory “www.compexplorer.com/images”. The HTML tag to show the image correctly is :

<img src=”http://www.compexplorer.com/images/example.jpg”>

With the HTML tag above, there’s no problem in any browser at all. The picture can be display correctly. But, unfortunately, it’s a wrong HTML tag according to W3C standard. How come?

W3C standarize the HTML tag for image with a minimum 2 attribute, consist of :

  • src : determine the target image to be displayed.
  • alt : determine the alternative text when the picture is not (yet) appear. If we do not want to display alternative text, we still have to inser this attribut with a blank (no text) inside.

Is it finish? Not yet. W3C also standarize a form for every HTML tag that do not have a closing tag, including image tag. It must be endded with a slash “/” before closed by a general closing tag “>”.

Then, we can make a correct HTML tag for image like this :

  • Without alternative text : <img src=”http://www.compexplorer.com/images/example.jpg” alt=”" />
  • With alternative text : <img src=”http://www.compexplorer.com/images/example.jpg” alt=”this is an example” />

Why should we follow the W3C guidance? Well, you can find the answer here. Enjoy!