Working with images in html, PHP Web Programming

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

134_WORKING WITH IMAGES in Html.png

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

<HTML>

<HEAD>

<TITLE>XYZ</TITLE>

</HEAD>

<BODY BGCOLOUR="#FFFFFF">

<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.                                                                                                                                                  

</BODY>

</HTML>

 

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.

<BODY BGCOLOUR="#FFFFFF">

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

</BODY>

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
Need help to SocialEngine Install on Amazon AWS Seeking someone with experience and immediate availability to install, customize as well as administer Social Engine (SocialEngin

We want help in WordPress Plugin Development - Route Delivery Schedule We want a plugin that has the ability to display Delivery Schedules based on a location filter in a calend

Question: (a) Write the HTML tags for the following text: Software List A. Module 1 • Adobe Illustrator CS3 B. Module 2 • Adobe Photoshop CS3 C. Module 3 • Maya •

Question: The best user interface design guidelines are guidelines that given high level and widely applicable principles. A set of such guidelines is as follows: (i) Know

Web programmer We want to allow logging on an S3 bucket to audit potential high usage from single users (example single IP addresses) on our Wordpress membership site. We wan

Create Interactive Weather Map using Weather Data API Looking for an experienced web developer to create an interactive weather map of the US using the Aeris API. Desired Ski

Magento community with Enterprise features on Amazon AWS We are concerned to run Multiple Magento community instances on Amazon AWS to support very high traffic. We as well like

Need a expert for Programming A Bandcamp(.com) for Writers and Zine Lovers I want someone who knows how to program a website like Bandcamp where users can have there own place t

How do Iconfigure SMTP on a server?

diffierence between ID3 and naive bayes alogrthim