Working with images in html, PHP Web Programming

Now let us make our web pages more exciting through putting in images.


You indicate an image along with the <IMG> (image) tag. Previously in this unit, on a page displaying the images was described via the BACKGROUND attribute of the <BODY> tag that displays the image like the background image. Background images built the page heavy and therefore the page takes a significant amount of time to load. But the <IMG>tag can be utilized for displaying an image along with the needed height & width. Let us look at an example






<IMG SRC="ima.jpg" WIDTH=130 HEIGHT=101 ALT = "IMAGE IS TURNED OFF" ALIGN = "BOTTOM" BORDER = 2> This text is placed at the middle of the image.                                                                                                                                                  




1415_WORKING WITH IMAGES in Html1.png

Figure: Displaying Images on a Web Page

Let us take a consideration at the syntax of the <IMG> tag:

<IMG SRC = "FILENAME.GIF" WIDTH = "value" HEIGHT = "value"  ALT = "alternate text" BORDER = "value" ALIGN = "value">

 a. SRC: This attribute denote the pathname to the source file that contains the image. The value in the above example, "image.gif", refers that the browser will look for the image named image.gif in the same folder (or directory) as the html document itself.

b. WIDTH: This is used for specifying the desired width of the image.

c. HEIGHT: This is used for specifying the desired height of the image.

d. BORDER: An important attribute of the IMG tag is BORDER. This attribute denoted the width of the border of the image. By default it is 0, i.e. there is no border. As shown in Figure the image "image.gif" has been given a border 2 pixel wide. The following code gives a wider border to the above image.


<IMG SRC="image.gif" WIDTH=130 HEIGHT=101 BORDER=10>


e.  ALT: Another IMG attribute that is important is ALT. ALT is sort of a substitute for the image that is displayed or used when the user is using a browser that does not display images. Someone may be using a text only browser, he might have image loading turned off for speed or he may be using a voice browser (a browser where the web page is read out). In those cases, that ALT attribute could be very important to your visitor as it could be used (given the proper text) to describe the image that is not on the screen.

Posted Date: 4/22/2013 3:40:12 AM | Location : United States

Related Discussions:- Working with images in html, Assignment Help, Ask Question on Working with images in html, Get Answer, Expert's Help, Working with images in html Discussions

Write discussion on Working with images in html
Your posts are moderated
Related Questions
We need help for Website design to HTML We are in search of an experienced HTML Developer with bootstrap and responsive skills. Job Description: We need to create HTML pag

Personal account component for Joomla It is essential to develop a component for CMS Joomla which will permit visitors of a site to receive necessary information of financial ch

Seeking a team to build advanced website with two web applications Seeking an experienced team to build a state of the art website for my hair company that comprises two applica

Cakephp plugin needed to plot charts with nv3d.js I have a database where I have pairs of date times and values. I want a cakephp plugin that permits me to plot them using nv3d.

I need a Web Developer for Venture Capital Firm We're looking for a Web Developer. Your Qualifications 1) Compelling portfolio that demonstrates innovative design 2) Ability

specify a form field where the user can enter large amounts of text. In most respects, works as an field. It can contain a name and

A skilled Amazon API is required We have a website where we significance products from an ecommerce site as well as pushing the products to ebay as well as getting sales reports

Need help from Senior Website Coder wordpress A marketing firm for international brands. Job Description- We're seeking for a Web Developer. Your responsibilities- I'm

Set the element's dimensions using row & column attributes in the textarea tag so the data entered is easily viewable.  The element of course requires an appropriately descriptive

error_reporting(0); session_start(); header(''Content-type: text/html; charset=utf-8''); include_once(''../../xajax_core/''); // ?? xajax $xajax = new xajax()