Jacob Snyder Jacob Snyder - 2 months ago 19
CSS Question

How to link .html files

Alright. I'm coding in HTML and i have gotten stumped on a prob. I have 3 files: file4.html(main), buy.html, and CSS.css and I'm trying to figure out how i can put a link on file4.html that takes me to buy.html. Edit: How do you add the buy.html to the same directory?

Answer

This example will open the linked document in a new browser window/tab:

<a href="http://www.example.com/" target="_blank" title="Visit My Page">Visit My Page</a>

You can use target="_top" to break out of the frame:

<a href="http://www.example.com/html/file4.html" target="_top" title="Visit My Page">Visit My Page</a>

Useful Tips Section

Then, add a link to the bookmark ("Useful Products Section"), from within the same page:

<a href="#products" title="Visit the Useful products Section">Visit the Useful products Section</a>

Or, add a link to the bookmark ("Useful Tips Section"), from another page: Example

<a href="file4.html#products" title="Visit the Useful products Section">Visit the Useful products Section</a> 

--

<a href="page2.html" title="Link">Link</a>

If you have page2.html at the same level with folder then the path is:

<a href="../page2.html" title="Link">Link</a>