SUMMARY 5 - CHAPTER 4/13


LINKS

Links are made by using the a tag. Within that tag is the attribute href. This attribute is where the URL goes. By having this tag and attribute in the HTML, the result is a simple hyperlink. These hyperlinks can lead to other web pages within the website or other websites all together. If you want to have your hyperlink lead to other pages on the same site, you don’t have to specify the domain name in the URL, what you would use instead is a relative URL. What this would look like, for instance, would be index.html, or whatever the name of your page is.

ORGANIZATION

A way to organize the structure of your site is by placing your various sections of your site into folders. The overall structure of your directory starts with the root folder, the folder at the top. The root folder holds all of the files and folders for the website. Stemming from the root folder first, would be the homepage. The homepage will always be identifiable as index.html, regardless of the content of the homepage. For any secondary pages, they can be named whatever you’d like, these will appear beneath the homepage in the directory. Your folders are arranged in the parent and child format, the child folder stemming from a parent folder. If you had a folder stemming from the child folder, that would make that folder a grandchild, thus making the original parent folder, a grandparent. The way that folders and files are organized is almost in a tree-like fashion, no matter what, everything stems from one root.

LINKING SPECIFIC PARTS OF PAGES

In order to link a specific part of the same page, there’s a few steps you need to take. First, you have to identify the points within the page where the link will go. This would be identified by an attribute similar to the following: h1 id=”top”. In order to then link something on the page, you have to add your hyperlink wherever you’d like with the attribute href= “#top”. The most important part here, is the hashtag within the href attribute. In order to have links to a certain part of another page, you would do something similar to the prior. All you would have to add is the address for the page within the href attribute, followed by the hashtag symbol and the id.