The images on a webpage are managed by the image element in html; <img> tag in specific. The images are specified in the tag with the help of the path address it is situated on your local directory or on your server. This path is incorporated in the "src" or the source attribute of the <img> tag.
You also have the "height" and "width" attributes in the <img> tag in order to have a fixed area covered by the exact image you want no matter if its smaller or bigger than your requirement, you can always work it down to your need.
Test code : ( Use this code to display images in your page )
<!doctype html>
<html>
<head>
<title>
My page still has a title within head tag
</title>
</head>
<body>
<img src="c:/images/image.jpg" width="104" height="142" />
</body>
<html>
Note: The address in your src attribute is subject to change with your image's location. Please give the location as per the format. And always remember to specify the correct extension for the image at the end eg: .jpg, .gif, .png etc.
Next is the hyperlinks to direct to a new page or address with a single click on the specified link. As we know the internet works on the interconnection of html documents across the websites. These links which provide a gateway to the other pages are the hyperlinks. We can create links easily with the <a> tag or Anchor tag and its attribute "href" which stores the reference address to which the page is to be directed and the text for link is displayed between the opening and closing tags. The anchor tag makes it a task of few character to divert to a new address from a link.
Test code : ( Use this code to direct to google.com by clicking the link )
<!doctype html>
<html>
<head>
<title>
My page still has a title within head tag
</title>
</head>
<body>
<a href="http://www.google.com/">This is a link</a>
</body>
<html>
NOTE: The above link will redirect the page to "google.com" when you click the text "This is a link" in the browser. Make notice that nothing about the address google.com will be displayed in the browser only the text between the anchor tag "This is a link" will be displayed.
Do type the "http://" before the address google.com else it may not work.
Comments
Post a Comment