Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating links

From: Creating a CSS Style Guide: Hands-On Training

Video: Creating links

We have marked up all the parts of our page, but we haven't done one of the most fun and most interesting things that is unique to web pages, that they link to other places, that there's interactivity. So let's take a look at how to add interactivity to our website by creating links. At the top of the page I have created a simple text navigation bar. It's really easy to use. It's really easy to create. They are used frequently within web pages and often seen at the bottom of the web pages as a way for people navigating to jump around through the website without having to scroll back up to the top.

Creating links

We have marked up all the parts of our page, but we haven't done one of the most fun and most interesting things that is unique to web pages, that they link to other places, that there's interactivity. So let's take a look at how to add interactivity to our website by creating links. At the top of the page I have created a simple text navigation bar. It's really easy to use. It's really easy to create. They are used frequently within web pages and often seen at the bottom of the web pages as a way for people navigating to jump around through the website without having to scroll back up to the top.

How did I do this? For each section of your web page, you put a text name, space, then type a pipe. The Pipe key is essentially found below your Delete key on your keyboard. If you hold down your Shift key plus your backward slash key that will create the pipe. So let's go through this just one more time. Here is your section name, pipe key, section name. You can do this all the way across the top of your page or at the bottom of your page and quickly create a text navigation bar. We will style this later on with style shades, but it's familiar to your user, easy to use, easy to understand how it works.

Currently we can tell by just looking at the text navigation bar that it isn't working. We don't see any of the clues that make us think that it is a hypertext link to something else. How do we create that? Select the name Link1 and let's go down to the Property Inspector and at the bottom we will see there is a link followed by a text box. Put your I-beam inside that text box and this must be done exactly as I say. There are no shortcuts, no easy way around this. You need to put the complete URL locater address.

It typically starts with http, Hyper Text Transfer Protocol, and follow it with a colon, not a semi-colon, \\www. firefox.com. Tab out and as soon as you tab out of the box, if you look back up at the top of your document window, you will see that now the physical attributes make you think it's a link.

It's dark blue and it's underlined. Let's see how this looks in code. We will click on our Code button. Go up there. Wherever your anchor tags, which is what a link tag is called, are, they will be in green. They are easy to spot inside of Dreamweaver because of this color-coding. I'm going to select this tag right here. You can see it wraps around the word, but the actual reference to the website that we want to jump to is inside an attribute called href. This stands for Hypertext Reference.

Remember we don't embed things inside the web page; we link to things inside the web page. Now if you saw that you made a mistake or you had typed this incorrectly, for instance, my boss says to me, 'Laurie, I don't want you to use Firefox as an example. They are a proprietary company. Could you use the W3 organization instead?' I can easily change this inside of Code view by simply coming in here, selecting Firefox.com and typing w3 dot, remember dot, not comma, org.

If I click on my Refresh button, that automatically will update that code and now the link will go there. Let's go back to Design view and let's test this link in a browser to see how this works. One of the things that interactivity is the best place to test it is in the browser if you really want to simulate what your user experience is going to be like, you are going to do it in the browser just like the user would be doing it. We will come over to this button that looks like the world and preview it in Firefox. In order to preview a web page in a browser, you need to save your document. So let's go ahead and save. That takes us right out to Firefox, there is our page, looking good. Let's click on that link.

Well that's great, the link works. It jumped us right to the World Wide Web Consortium. However, there is one thing wrong. We jumped right out of our own website. We can't see it, we can't find it. Now of course, we could click on the Go back one page button, but that's not really an intuitive way nor a visual way for our users to go back and forth through pages. They are expecting to stay within a website but to link to many, many places and still be able to go right back to where they are. So let's see if we can fix that inside of Dreamweaver. Let's click on Dreamweaver and let's look at that link. Down at the bottom in our Property Inspector, we can see there is something called Target. Insert your I-beam inside of there and we can make it open in a new window or a new tab by clicking on the _blank selection. Let's save this. Let's see how that affected our code. You have a new attribute called target_blank. Let's go back to Design view and now let's preview that in our browser. Click on that link.

Terrific! Notice it opens up in a new tab. We can tab back to my site, go out to the World Wide Web, close the World Wide Web and still be in the site that I created. This is the user expectation currently. They have gotten very sophisticated about browsing. Users are expecting these kinds of usability features. They don't want to get lost, they don't want to be confused and they don't want to be disoriented. Let's close Firefox, go back into Dreamweaver and let's set up a couple of more links. Let's practice that one more time. Let's double click on Link2, go down to the Link text box at the bottom in the Property Inspector, let's type on http://www.google.com, tab.

As soon as we tab, our I-beam moves over to the target area and we will select link. Let's check that in code to make sure that we have done the right things. Let's find that link right here. I'm going to select the whole link so you can see it. So there is the link, wrapped properly with the anchor tag, the anchor tag takes us to a location and pins to a place. There is my reference to the URL and there is my target to open in a new window or in a new tab. Let's go back to Design view.

Often when we are designing for a website, we don't know where are sections are going to go to. We don't know the names of the pages that we want to link to. So a great way to setup the interactivity and to simulate it, but not know exactly what the names of all these things are going to be, is to use a little piece of JavaScript called the hash mark. Let's double click on Link3, return to our Property Inspector, click on the Link text box, hold down our Shift key and type in 3. That makes the hash mark.

Now Hatch mark is used in JavaScript all over the place and in JavaScript it stands for "by the name of." In this case, we are just using the hash mark to create a placeholder link. It won't go anywhere and we'll test this out in just a moment. Tab out to make that update. Click on Link4, go down to your Link text box, type another hash mark, tab out. Let's click on Link5, click inside of the text box for Link, type another hash mark, tab out. Remember to preview our web page. We need to save it. Let's do Command+Save. But before we preview the dummy links, let's see how they look inside Code.

So we have Link5 selected in our Design view and you can see that we still have our A tag or anchor tag wrapping that. There is our link that the user will see and here is our reference to the hash mark, right here. So it appears just like the URL would. It must be inside these quotation marks, any attribute must be inside quotation marks if you are working with HTML as we are. Let's click back on the Design view. Do one more Command+Save, click on Preview in browser inside of Firefox and let's look at how these links behave inside the browser.

If I hover over Link3 and you look at the Status bar at the bottom of the browser window, you will see that it simply shows the web page that we are in, followed by a hash mark. I can click on it to see that the link works and get the user experience, but I don't jump anywhere. So this is a great tool for designers and developers to prototype something and to test something out, but not worry about knowing all the names because a lot of this work gets done as you are in process working with the client. Each one of the links 3, 4 and 5 work the same way and remember our first two links actually take us out to real locations. Let's close Firefox and click back into Dreamweaver.

There is one link I haven't shown you which is how to link internally to another page within a website. We will eventually get around to that kind of information, but since this is a one page website, it doesn't really make sense to show you how that would work because we have no place to link internally. Let's scroll down to the bottom of the page and there is one more link I want to show you, how to do E-mail links. I have put a little visual prompt, which is put your e-mail in there, Laurie, and I'm going to select my name at Mydesigns.com.

This is the proper way to write an e -mail address. This is just a dummy placeholder for what we are demonstrating in this project. I'm going to select this text, copy it, go down to the link area and paste it. It's still not correct. I must use the correct protocol or addressing. So I'm going to place my I-beam in front of the e-mail address and type mailto followed by a colon. As soon as I type "mailto" followed by a colon, the browser will recognize this as being an e-mail address and not a link to a website or to an internal HTML page.

Go ahead and click tab. In this case it doesn't matter about target because we are not opening up a website inside of a browser. We are going to open up an e-mail mail client hopefully. Let's save this. But before we go, let's check this out in Code. So again, it has the A tag. You are seeing the versatility of the A tag or the anchor tag, but in the href area, inside the quotation marks we now have mailto followed by an e-mail address. Go back to Design view, save your document one more time, preview it in the browser in Firefox, scroll to the bottom. Let's click on this.

Terrific! There we go. Our mail client opened up and we are ready to send an e-mail right out to that address. I'm going to close mail and before we leave the Firefox, I'm going to just want to show you one more thing, because we have clicked on all of these links, notice they have changed colors or changed date. This means we have already visited. This is called a visited link. Let's close Firefox and return back into our document. So in summary, to add interactivity, we have learned that the A tag is what adds hypertext linking. That there are four kinds of links that we can create: links to another website, links to an internal page within our website. We can create a dummy or placeholder link using JavaScript and the hash mark and the fourth we can create a link is by actually doing a mailto e-mail address.

We have learned that the link must be typed absolutely specifically correctly in order to work. So now our pages can really have some zip and fun and go all over the universe and take the full benefits of what it means to create websites on the World Wide Web.

Show transcript

This video is part of

Image for Creating a CSS Style Guide: Hands-On Training
Creating a CSS Style Guide: Hands-On Training

35 video lessons · 28049 viewers

Laurie Burruss
Author

 
Expand all | Collapse all
  1. 6m 58s
    1. Welcome
      1m 9s
    2. Objective of this course
      3m 38s
    3. Using the exercise files
      2m 11s
  2. 28m 26s
    1. Starting Dreamweaver for the first time
      3m 38s
    2. Defining a website
      4m 3s
    3. Understanding the Dreamweaver interface
      9m 43s
    4. Setting up a custom workspace
      4m 10s
    5. Setting essential preferences
      6m 52s
  3. 56m 54s
    1. Laying out a page in a text document
      3m 40s
    2. Creating and saving a new document
      3m 27s
    3. Inserting an image
      8m 22s
    4. Marking up text using the Property Inspector
      6m 48s
    5. Marking up text by hand
      9m 21s
    6. Inserting, formatting, and selecting a table
      8m 16s
    7. Creating links
      12m 26s
    8. Styling a footer
      4m 34s
  4. 22m 15s
    1. Using Modify Page Properties to create embedded styles
      12m 22s
    2. Creating links with CSS
      4m 55s
    3. Working with Code, Split, and Design views
      4m 58s
  5. 8m 52s
    1. Defining browsers to test a web page
      2m 24s
    2. Previewing a web page in a browser
      6m 28s
  6. 16m 44s
    1. Using a span tag to add a class and customize appearance
      10m 34s
    2. Using the Tag Inspector to create and edit additional styles
      6m 10s
  7. 48m 42s
    1. Exporting existing styles into an external style sheet
      7m 0s
    2. Using the CSS Styles panel to add a new style
      5m 43s
    3. Using the div tag to create a content container
      11m 8s
    4. Overriding the default browser styles
      2m 46s
    5. Applying padding and margins
      4m 57s
    6. Styling header tags
      5m 34s
    7. Creating and styling compound tags
      5m 12s
    8. Editing preexisting rules
      6m 22s
  8. 19m 36s
    1. Improving the Footer
      5m 12s
    2. Commenting a CSS style sheet
      7m 0s
    3. Creating a custom color palette
      7m 24s
  9. 3m 6s
    1. Style sheet final review
      3m 6s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating a CSS Style Guide: Hands-On Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.