Category: 

What is an Inline Image?

Article Details
  • Written By: Sonal Panse
  • Edited By: Bronwyn Harris
  • Last Modified Date: 26 September 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The atmosphere of Jupiter's moon Io collapses every time it is eclipsed by the planet.   more...

September 29 ,  2008 :  The Dow Jones Industrial Average experienced its largest one-day drop in history.  more...

An inline image is a graphic image that is inserted into a web page to add visual appeal, provide information or to represent a hyperlink. Inline images are usually in GIF, JPEG or PNG formats. They are incorporated into a web page using the data URI scheme.

Data URIs allow the embedding of small sized data that can be instantly retrieved by the browser. Inline images are retrieved by the browser along with the HTML and displayed as part of the web document. For the browser to be able to retrieve and display the images without too much time and trouble, it is advisable to use small-sized inline images.

Larger images would slow down the loading time, and cause the site to take a long while to appear on the screen. Most web visitors don't have the patience to hang around to see it happen. This would adversely affect site traffic.

HTML inline images are sourced from the server of the website in which they are to be displayed, or included from other external servers. Using inline images from external sources is a matter of contention as this can be done without permission. The img tag is used to insert inline images into paragraphs and headings in the web page. The img tag cannot be used in a free-floating form. It has to be enclosed inside another element.

Ad

The required attribute of the img tag is the src attribute. The src attribute specifies the web address or URL from which the browser can retrieve the image file. Apart from the src attribute, HTML inline images can be defined by three optional attributes. These are alt, align and ismap.

The alt attribute provides an inline image text alternative. So, in case the viewer's browser does not support graphics, the viewer will see the text in place of the image. Using the alt attribute is highly recommended.

The alt attribute value can be an empty string. For example, if there is a decorative image, it is not necessary to provide alternative text for it. Therefore, the alt attribute value can be left blank.

The inline image style can be set with the align attribute. The align attribute tells the browser where the inline image must appear in relation to the text on the web page. The inline image can be aligned with the top, middle or bottom of the adjacent text on the web page.

With the ismap attribute, an inline image can be marked as an active image map. This means that different parts of the image can be made to produce different actions whenever someone clicks on the different parts. For example, if there is an inline image showing Earth and Saturn, clicking on Earth may lead to information about Earth and clicking on Saturn may lead to information about Saturn.

Unlike the alt and align attributes, the ismap attribute does not work by mere inclusion in the img tag. It requires some configuration done on the server. Some amount of programming knowledge may also be required.

Ad

You might also Like

Recommended

Discuss this Article

KoiwiGal
Post 4

@Mor - It's usually just .gifs that I have a problem downloading, but .jpgs and .png don't seem to bother most modern internet connections very much unless they are huge files. If it's an inline image it shouldn't be that big in the first place.

Mor
Post 3

@irontoenail - That must be quite confusing for them sometimes, as I know that people often use the alt text as a means of stuffing in key words and phrases rather than accurately describing the image.

My favorite trick is when artists use the text to add something to the image, like an additional joke on a comic or maybe more information that isn't in the standard text.

But in general I find inline images to be quite annoying because I don't have a particularly fast internet connection at the moment. Usually I just turn off images completely, preventing them from loading when I'm trying to find specific information.

It's much faster and it doesn't use up nearly as much bandwidth.

irontoenail
Post 2

You should use the alt text whenever possible anyway, even if you aren't concerned about the image not loading. For one thing it adds to the overall search-ability of the image and of the site in general because it can be scanned for key words. If someone is looking in Google's Image Search for a particular subject, it won't be able to find yours without the right key words.

But even more importantly, the alt text is often used by people with disabilities to understand an image. Sight impaired people, for example, will often have the alt text read out to them by a text reader.

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}