190 likes | 285 Vues
This lesson explores the fundamentals of web addresses and how to navigate through links effectively on the internet. Learn about clickable items, link states, pseudo-classes, and more.
E N D
How to get there from here. Lesson 5 – Unit E
The href tag has two major partsweb address what to click on
Address can be: Clickable item can be: • file name • folder(s)/file name • web address • location within a page • special item • text • image (or media) • text and image <a href=“address” >Clickable item</a> http://www.gccaz.edu is a valid web address www.gccaz.eduis a NOT a valid web address WHY?
Another page in same location. <a href=“page2.html” />my second page</a> A page that is external to the page. <a href=“http://www.cnn.com” />news</a> Click on an image. <a href=“bgdog.jpg” ><img src=“dog.jpg></a>
A different spot in the page – jump links <a href=“#taxinfo” />taxes</a> Need to create a location to jump to (also called a target) <h2 id=“taxinfo”> Open the new item in a different window (or tab). <a href=“p3.html” target=“_blank” />cat</a> Open an e-mail composition window. <a href=“mailto:alex@acme.com” />email me</a>
Link States "LoVeHAte" a:link link that has not been visited a:visited link that has been visited a: hover link that mouse is currently pointing over a:active link that is being clicked (literallyduring the time the users are clicking it.) ALWAYS SPECIFY IN THIS ORDER.
Focus "LoVeFears HAte" Applies while the link has focus—for example while a keyboard user’s cursor is on that link. Note: IE does not currently support the focus state, and just uses active in place of focus.
Traditionally, text links were blue if not visited and purple if visited, and there is still reason to believe that these are the most effective colors to use, although, again, with the increasingly widespread use of CSS, this is becoming less commonplace and the average user no longer assumes that links must be blue or purple.
Step 1 – Add link styles a:link { color: red; } a:visited { color: green; } a:hover { color: orange; } a:active { color: silver; }
PSEUDO CLASS Categorization of web page elements. Based on a relationship or condition of the element at a given moment, rather than a static property value. Allows you to style content dynamically. selector:pseudo-class {property:value;} http://www.w3schools.com/css/css_pseudo_classes.asp
Step 2 - Add pseudo class #menu a:link { color: gold; } #menu a:visited { color: cadetblue; } #menu a:hover { color: lime; } #menu a:active { color: tomato; }
Step 3 - Add div to menu links and name it menu. <div id="menu"> <h2 id="dog"> | <a href="r1.html" />Outside</a> | <a href="r2.html" />Inside</a> | <a href="http://en.wikipedia.org/wiki/Dachshund" />Dachshund Info</a> | Dog Gone | </h2> <div>
Time flies, but you are the pilot.