Ever wondered why links open in same window and in the same page as that of the site. For eg i have a blog with many buttons which open in a new page. One way is to use target in your html code.. like this <a href="http://www.blogger.com/test1.html" target="_self">click me</a>.There is a way however a page can be opened in a part of the same page using frames and using target of html
Follow these steps
1) Create four pages testx1.html, testx2.html, testx3.html, testx4.html
2)Create a page as index.html with the following code
<html>
<body>
<a href="testx2.html" target=spinac>
link1</a>
<br>
<a href="testx3.html" target=spinac>
link2</a>
<br>
<a href="testx4.html"target=spinac>
link3</a>
</body>
</html>
3)Create a page test1.html which will create frames (this page will be without a body tag)
<html>
<head>
<title>
html tutorial
</title>
</head>
<frameset>
<frameset cols="20%,80%">
<frame src="index.html">
<frameset rows="20%,80%">
<frame src="testx1.html">
<frame src="testx2.html" name="spinac">
</frameset>
</html>
Note that we have named the frame with page "testx3.html" as spinac and used target =spinac in the index.html page. You can clearly see that the pages will open in the target frame spinac.
I hope this was useful.
No comments:
Post a Comment