Question

In: Computer Science

Assume that there is an image “fewa.jpg” in the root of the HTML folder. Write HTML...

Assume that there is an image “fewa.jpg” in the root of the HTML folder. Write HTML code to insert that image with appropriate alternative text. Also, apply an appropriate title to the image.?

Solutions

Expert Solution

Let's Assume a directory Structure,

Now Let's See How we used the same Image "Fewa.jpg" in all the three HTML Files- ABC.html, XYZ.html, LMN.html placed at different locations.

XYZ.html- In this Since XYZ.html and The Image are in same folder hence we didn't do anything special simply use <img src="Fewa.jpg", It works fine

<html>
<body>
<center><h1> Inserting Image </h1>
<img title="Your Title" src="Fewa.jpg"></center>
</body>
</html>

ABC.html- In this case we are in HTML folder and image is in Images folder so we have to first go in that foler by images and then take the image, images/Fewa.jpg

<html>
<body>
<center><h1> Inserting Image </h1>
<img title="Your Title" src="images/Fewa.jpg"></center>
</body>
</html>

LMN.html- In this Case we are in Sub Folder and now we have to move one folder above back that's why we used "../" It will help us to get back to HTML folder, Then we can Go to images folder and then access the image.

<html>
<body>
<center><h1> Inserting Image </h1>
<img title="Your Title" src="../images/Fewa.jpg"></center>
</body>
</html>

All the three codes are running fine doing the same work just showing the image on the web page as you can see in output below:

This title thing just shows the text you have written in title field when someone hovers over the image.

OUTPUT:

Now Whatever things we used in above code like in LMN.html we used "../" to get into one above folder, If we did not use this like:

LMN.html

<html>
<body>
<center><h1> Inserting Image </h1>
<img title="Your Title" src="Fewa.jpg" ></center>
</body>
</html>

OUTPUT

Since we have directly used the image but the image is not in the same folder as of LMN.html hence it is unable to show the image.

It shows the text which we we placed in alt, It is only used for this purpose only that if image is unable to be loaded you can display the alternaive text regarding tat image.


Related Solutions

In the root of the project create a folder called res. In that folder create a...
In the root of the project create a folder called res. In that folder create a file called DemoFile.txt Create a class with a static main that tests the ability to resolve and print a Path: Create an instance of a FileSystem class. Create an instance of the Path interface for the DemoFile.txt file. Print the constructed Path with System.out.println() method. Create a class that does the following: Using a pre-Java 7 solution, create a class that tests streams in...
write a function to determine the square root of a number. The square root of a...
write a function to determine the square root of a number. The square root of a number can be approximated by repeated calculation using the formula NG = 0.5(LG + N/LG) where NG stands for the next guess and LG stands for the last guess. The loop should repeat until the difference between NG and LG is less than 0.00001. Use an initial guess of 1.0. Write a driver program to test your square root function. I WANT THIS PROGRAM...
Create a Home Page using HTML and CSS Part 1 • Contain an image or logo...
Create a Home Page using HTML and CSS Part 1 • Contain an image or logo about your website. • Must contain three navigation links. Home link. Registration link. Animations link. • Footer will contain links to web pages to any other site you wish (just be outside your webpage, like YouTube,etc.) Open links in new tab, not current tab. Create a Registration page: • Registration Fields: 1) User Name - Input Text 2) Password - Input Password 3) Repeat...
For this assignment, you will write a tic-tac-toe application in HTML and JavaScript, using an HTML...
For this assignment, you will write a tic-tac-toe application in HTML and JavaScript, using an HTML <canvas> tag. The game will be played "hot seat" where players take turns using the same device. Requirements: The canvas should be 600px tall and wide, with the gameplay area occupying most of the canvas. The X's and O's may be drawn using polygons or large-font text The grid should be drawn using polygons, specifically long, thin rectangles Before & between games, the canvas...
Write the below code to use HTML and JavaScript. 1. a) Write a JavaScript program to...
Write the below code to use HTML and JavaScript. 1. a) Write a JavaScript program to display the current day and time. b) Write a JavaScript program to print the contents of the current window.   c) Write a JavaScript program where the program takes a random integer between 1 to 10 d) Write a JavaScript program to calculate multiplication and division of two numbers (input from the user). e)Write a JavaScript program to create a new string from a given...
JAVA There is a folder named Recursive folder at the same location as these below files,...
JAVA There is a folder named Recursive folder at the same location as these below files, which contains files and folders. I have read the data of the Recursive folder and stored in a variable. Now they are required to be encrypted and decrypted. You may copy past the files to three different files and see the output. I am confused on how to write code for encrypt() and decrypt() The names of files and folders are stored in one...
I. At the beginning, create a folder named "test" and add the folder into the version...
I. At the beginning, create a folder named "test" and add the folder into the version control tool tracking system. Then create one file named "001" under this folder. Commit any change if necessary. II. Next, add another file named "002" in the same folder and commit the change ("adding") in the version control tool. III. Followed by adding that file, create a branch (namely, "branch-A") in the version control tool and make some changes to the contents in file...
Write an HTML document to provide a form that collects familynames and telephonenumbers. The...
Write an HTML document to provide a form that collects family names and telephone numbers. The family name should start with a capital letter, followed by at least one lowercase letter, and not include any spaces or any other characters, and the length should not be more than 30 characters. The phone numbers must be in the format (ddd)-ddd-dddd. Write a PHP script that checks the submitted last name and the telephone number to be sure that they conform to...
modify code to write the output as an HTML table to a file in the output...
modify code to write the output as an HTML table to a file in the output directory. The file that is saying to work at : SOURCE CODE IN PERL: print "Enter principal amount: "; $P=; while($P<=0) { print "Principal must be positive. Try again: "; $P=; } print "Enter number of times interest is applied in a year: "; $n=; while($n!=12 && $n!=4 && $n!=2 && $n!=1) { print "It must be 12, 4, 2 or 1. Try again:...
1- Write a Matlab program to perform image resizing, image rotation to 90 degrees, conversion to...
1- Write a Matlab program to perform image resizing, image rotation to 90 degrees, conversion to binary and gray scale, Image segmentation and extraction, draw and find the region of interest with a circle, Plot bounding box, Region extraction and histogram. 2- Write a MATLAB program to Design a GUI calculator which is as shown in below figure 1. Add tool bar options to the GUI calculator and Highlight specific codes written in program and signify the steps followed.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT