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!
Related posts:
- Tips for Faster Image Loading
- SEO for Image, Tips for your images
- Find Duplicate Image Using Image Comparer
- How To Create An HTML Newsletter
- Create a Favicon In Your Website
- An Ideal Solution to Upload Your PSD Files
- Hide Your Affiliate Link
- Introduction to Web Browsers
- What is Valid W3C Web?
- How To SEO A Website From Scratch – Free SEO Tutorial (Part 4)
[...] image on a web has become a current needs for almost every websites. Images is often use as a banner, [...]
Tips for Faster Image Loading | Comp. Explorer — December 28th, 2008 at 2:56 pm[...] ended slash can really helps in SEO for image. But, this tag and ended slash is a must for every image in our site to make sure that our site is a valid W3C site. Since we know that having a valid W3C [...]
SEO for Image, Tips for your images | Comp. Explorer — January 31st, 2009 at 2:23 pmInteresting blog you got here but I can’t seem to find the RSS button.
Eden Hibbard — March 18th, 2010 at 10:06 am