Base Tag

 



BASE TAG


If we want to give a lot of images on the website then we don't need to give img src = "file location" again and again, use bast tag in the heading tag er in html file, and img src = image name.jpg (.jpg or Image format) The image will appear on the webpage.


Step:1 

First of all, create a folder on the desktop with any name.


Step:2

 Then drag the html file to that folder.



Step:3

And create another folder in this folder called image.



Step:4

And put all the pictures in this folder (the pictures you want to put on the webpage.)



Step:5

Now before writing the html code, you have to look at the location of the pictures.

    •  Right Click on Image Then Click Properties.


Step:6

Now you have to give the location of the image file with the help of base tag in the head tag 
in the html file. And in the body tag, you have to write the format with the name of the image.


<html>
<head>
<title>Base Tags</title>

<base href="C:\Users\Tito\Desktop\HTML\Image\">

</head>
<body>

<img src="elephant.jpg">

</body>
</html>

 


<html>
<head>
<title>Base Tags</title>

<base href="C:\Users\Tito\Desktop\HTML\Image\">

</head>
<body>

<img src="elephant.jpg">

<img src="lion.jpg">

<img src="tiger.jpg">


</body>
</html>
 
   

 




Step: 7

If we want to change the size of the images on the web page, we could do so with the help of height and width.


<html>
<head>
<title>Base Tags</title>

<base href="C:\Users\Tito\Desktop\HTML\Image\">

</head>
<body>

<img src="elephant.jpg" height="200" width="250">

<img src="lion.jpg" height="250" width="200">

<img src="tiger.jpg" height="300" width="500">


</body>
</html>

 



Previous
Next Post »
0 Komentar