To begin working with hyperlinks.
Web Programming book reading for THIS class
a
Elementindex.html
Filea
Element Additional DetailsWeb Programming book reading for NEXT class
img
ElementQuestions from our last class or the readings?
Cursor Properties
selector:hover { cursor: property; }
source: http://www.javascripter.net/faq/stylesc.htm
Clearing the Browser Cache
If
<a href="filename">...</a>
<a href="page30.html">go to page 30</a>
<a href="#idname">...</a>
<a href="#exercise">jump to the exercise section</a>
target
attribute
source: Dean, Web Programming, fig. 6.8, p. 238
target="_blank" =
open the linked document in a new window or
tab (as determined by browser settings)target="_self" =
open the linked
document in the same frame as it was clicked (this is default)target="_parent" =
open the linked document in the parent frametarget="_top" =
open the linked document in the full body of the
window
source: Connolly & Hoar (2018), Fundamentals of Web Development, fig. 3.14, p. 89, slide 30 for Chapter 3 (updated by JMH)
source: Connolly & Hoar (2018), Fundamentals of Web Development, fig. 3.14, p. 89, slide 31 for Chapter 3
source: Connolly & Hoar (2018), Fundamentals of Web Development, slide 32 for Chapter 3
index.html
FileIf a file named index.html
is present in a directory, it is automatically
loaded when the user navigates to that directory.
This is how our course website works.
http://cssdweb.edu
the web server’s configuration
file tells it to go to
directory \\PI\cssd.local\D\Dropboxes\Website Development I\cssdweb.edu
index.html
file that redirects the web
browser to file index.php
index.php
runs on the web server behind the scenes —
it does not output anything to the user’s browser — and figures out which
term we’re in index.php
then redirects the user’s browser to
the Course Information page for the current termThat may sound like a lot of processing, but it all begins with
the index.html
file.
Our textbook contains a wealth of information that we don’t have time to cover in class.
“In presenting the web page’s content, it’s important to be consistent with your text and colors.”
There is a rather extensive discussion of an excellent example of a menu that links to various places on a page that is similar to what our course website does on the Course Information page.
The book also discusses how to apply CSS to links. Everyone should be able to read and understand that section.
Without CSS – With CSS (developed in response to a question from a previous student in this class)
Making a link button
<p><a href="#"><button>Return To Top of Page</button></a></p>
Goal: To create a web page that incorporates hyperlinks.
Preamble: There are two exercises described here. You are welcome to do either or both or something similar of your own design.
By now you have created a number of web pages. In this exercise you will create an index page that links to each of those pages.
You might choose to list your pages as a numbered (ordered) or an unordered list, or you might choose to list them using a completely different structure.
You also don’t have to use your page’s file names in your list. You can list each page with a descriptive title and only use the file name in the
href
attribute of the enclosinga
tag.For example, this page might be coded as:
<a href="ClassPanel-07.php" target="_blank"> Class No. 7: Using Hyperlinks</a>
Alternatively, add a menu of internal links to one of your pages as done at the top of this page. Remember that to do this, there are two steps:
id
attributes to the page elements that you want to link to. #
followed by an id
value as the target of the
link that you create in your menu. id
value as the href
attribute of the
enclosing a
tag.
This is Class No. 7. It was last modified on
Saturday, October 21, 2023 at 4:38 PM. Copyright © 2010-2024 by Jesse M. Heines. All rights reserved, but may be freely copied or excerpted for
educational purposes with credit to the author.