HTMLGoodies
The ultimate html resource
Earthweb.com


About the Double-Underlined Links



Search Clipart.com:



internet.commerce
Promotional Gifts
Compare Prices
Condos For Sale
Laptop Batteries
Imprinted Gifts
Desktop Computers
Computer Hardware
Free Business Cards
Memory Upgrades
Online Education
GPS Devices
SMS Gateway
Promotional Pens
Domain registration

HTML Goodies : Beyond HTML : Reference Pieces: So You Want To Set Up Your First Site, Huh?

 Silverlight 2 SDK for Visual Studio 2008
This package is an add-on to the RTM release of Visual Studio 2008 to provide tooling for Microsoft Silverlight 2 Beta 1. It provides a Silverlight project system for developing Silverlight applications using C# or Visual Basic. »
 
 Article: What Does it Take to Build the Best RIA?
With the proliferation of Rich Interactive Application (RIA) platform choices out there, you no longer have to take a one-size-fits-all approach to developing your next RIA application. Knowing the strengths (and weaknesses) of each platform can help you to decide the best RIA for your next application. »
 
 Expression Blend 2.5 Preview
Use Expression Blend 2.5 to create and modify managed Silverlight 2-based applications. Expression Blend for Silverlight 2 includes all of the features in Expression Blend 2 but has not reached the quality level of Expression Blend 2 for WPF or Silverlight 1 development. »
 
 The Hottest Mobile Platform Meets the Hottest RIA Platform
With the Symbian OS now supporting Microsoft Silverlight, mobile developers can bring new and exciting capabilities to handsets all over the globe. Find out why developers now need to make mobile devices a core part of their RIA development strategy. »
 
 Article: Leveraging Your Flash Development with Silverlight
You're not giving up Flash any time soon (and we don't blame you.) But if you could get your Flash application working in Silverlight, why wouldn't you? We show you the tools and techniques required to have your rockin' Flash application rolled for Silverlight. »
 

HTML GOODIES TO GO NEWSLETTER


Other Related Newsletters

Intel Whitepaper: Improve Security and Control of Your PCs

So You Want To Set Up Your First Site, Huh?


By Joe Burns

...use these to jump around or read it all

[Putting A Site TogetherThe HREF Links]
[In Site vs. Off Site Links] [Directory Structure]
[Internal Links] [To Use Full URL, Or Not]
[What If I Do Use the Full URL?]
[Are There Exceptions To This?] [The Home Page Links]

     Answering a ton of email every day allows me to keep an eye on when the new batch of HTML writers come into the fold. The questions I receive always become more and more difficult, and then all of a sudden...they become much simpler. The new group of people has arrived.
     What's more, in my constant want to write tutorials on new and more difficult topics, I forget to create more beginning-level tutorials. In that vein, I offer this tutorial.


Putting A Site Together

     Lately, I've been getting a lot of email asking about setting up a site with numerous internal pages. For example, let's say you create a homepage. We'll call it homepage.html.
     You then create three more pages:
  • links.html (A page of your favorite links)
  • photos.html (A page of your favorite photos)
  • story.html (A page with one of your best stories)

     At the moment they are just sitting on your hard drive (or floppy disc) and now you want them to become a site. Homepage.html will offer links to the three other pages. That'll be your first site. Good. Now, how do you do it?


The HREF Links

     First off, I'm assuming you already have a place to post these pages.
     So, now you have a place for your files. This "place" you have been given is actually a small section of a hard drive on a server somewhere. In computer terms, you have a directory where you can place your files. Think of this directory like an equal to a floppy disc. It's a contained area where the pages, and all the images that go on those pages will be housed.
     This is important to remember when you're writing the links that will connect these four pages together.

In Site vs. Off Site Links

     You've probably already read through
Primer Four - Creating Links. If not - give it a once over pretty soon. It'll give you the basic format of a link. Now let's talk about the pages you'll link to.
     First off, let's attach to a page outside of your site. Here's the basic format:

<A HREF="http://www.htmlgoodies.com">Click Here</A>

     Note the address above is a full URL. ("URL" stands for Universal Resource Locator. It's a fancy way of saying "web address") It starts with that http thing and ends with that .com deal. It's a full address.

     Now let's look at what I call an internal link. This is a link that stays within your own site. One of your pages is calling for another one of your pages. We'll say this is a link from your homepage.html to links.html. Remember that from above? Here's the format:

<A HREF="links.html">Click Here</A>

     Notice I'm only calling for the page, without the full address attached. Why? Well, because I don't need it. To make the point a little stronger, let's look at the directory structure of web addresses.


Directory Structure

     For the sake of continuing this discussion, and because I love to hear myself talk, let's take this little fantasy of mine a bit further. You purchase an account on a server called www.joeserver.com. When you sign up for your account, you choose the login "schmoe". This means that, most likely, your email address will be schmoe@joeserver.com and your web site address will be http://www.joeserver.com/~schmoe. The little squiggly line thing (~) is called a tilde. It tells the server, "There is one directory on this server called 'schmoe'- find it."
     When you use your
File Transfer Protocol (FTP) program to upload files to your new server, you will upload into the directory that was set aside for you - in this case, schmoe.
     So you upload your homepage.html page into your directory. The address of that page is now http://www.joeserver.com/~schmoe/homepage.html.
     See the slash I added and then the name? I do that because the homepage.html page is now inside your directory called schmoe.

     Think of a directory structure as one item being inside of a larger item. For example, a word is inside of sentence, is inside of a paragraph, is inside of a page, is inside of a chapter, is inside of a book. If this were written in directory structure format, it would look like this:

Book/chapter/page/paragraph/sentence/word

     It gets smaller as you move to the right, each is inside the previous. Take this URL for example:

http://www.server.com/users/pages/ohio/joe.html

     In that URL, the page "joe.html" is inside a directory called Ohio, is inside a directory called pages, is inside a directory called users, is on a server called server.com.

     That's why the page homepage.html is at the end of the address above. Make sense?


Internal Links

     Now we put together a site in your own directory. Once again, you have a homepage called "homepage.html" and three sub-pages that you want to link to from homepage.html. They are "links.html," "photos.html," and "story.html". First off, you need to to FTP, or "upload" all four pages to your directory. Now, here's the first link on homepage.html that will call up your links.html page.

<A HREF="links.html">Click Here</A>

     Notice I am only calling for the page by its name. I am not using the full address.
     Now, I could use the full address. There's no reason why I couldn't. If you followed along with the discussion above, you'll remember that since the file was uploaded into the schmoe directory, its full address would be http://www.joeserver.com/~schmoe/links.html. So why not use it?


To Use Full URL, Or Not To Use Full URL

     If you are linking to a page off of your site, then you must use the full URL. The reason is that you are leaving your own directory. In fact, the chances are really good that you are leaving your server all together. Because of that, you need to offer your HREF command the full address to the new site.
     But when you're staying within your own site, as we are above, you need only call for the page name. You see, your directory is a closed home for all of your pages. If you only call for a page or an image through its name minus the full address, what happens is that the server looks for the page or the image inside the same home that houses the page that called for it. In other words, servers will search a page's home directory by default. That's good to know when you create your links. It means you only have to use the page's name minus the full URL.

What If I Do Use The Full URL?

     Always playing the rebel, huh? The answer is that your internal links might run slower. You see, if you use the full address, what happens is that when your user clicks on a link, a full search process begins. First the server is located, next the directory is located, then the page is located. Whereas, if you use only the name, the search is already at its destination. The server simply searches itself. Slick, huh?


The Home Page Links

     So what is written onto homepage.html to link the pages together? This:

<A HREF="links.html">Click Here for My Favorite Links</A>
<A HREF="photos.html">Click Here for My Photos</A>
<A HREF="story.html">Click Here for My Best Story</A>

     Now you're all linked up. Hey! You made more than a couple of pages. You linked them all together. You made a site.

 

Enjoy!

 

[Putting A Site Together] [The HREF Links]
[In Site vs. Off Site Links] [Directory Structure]
[Internal Links] [To Use Full URL, Or Not]
[What If I Do Use the Full URL?]
[Are There Exceptions To This?] [The Home Page Links]

Back to the HTML Goodies Home Page
Tools:
Add htmlgoodies.com to your favorites
Add htmlgoodies.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

IT Management Networking & Communications Web Development Hardware & Systems Software Development Earthwebnews.com



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES