Jump to content

<link> tag in XHTML 1.0 trans

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
For my XHTML class we're supposed to create a template page to use for other pages. The teacher wanted doctype, head, title, body, and basic link and meta tags included.

I looked at w3schools for help, but that didn't much help. Their example used stylesheets in the example, which we haven't learned anything other than the very basics so far.

What would be simple link tag?


Thanks,

Cody

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Well, what do you have so far? It sounds like a pretty short file, maybe a dozen lines.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
Yes, it's a very short file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head profile="http://dublincore.org">
<title>Default</title>
<meta name="Author" content="Cody Hanner" />
<meta name="Description" content="XHTML Class Assignment" />
</head>

<body>
</body>
</html> 

I just don't understand the purpose of the link file honestly... with something as simple as this. I don't see what why it's needed.

#4
DarkLordoftheMonkeys

DarkLordoftheMonkeys

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 255 posts
A <link> tag is basically what the name says. It connects the HTML page to another file. There are two main uses for a <link> tag.

1. Using an external stylesheet:

<link rel="stylesheet" href="mystyles" type="text/css" media="all" />


The media part is not necessary, but it tells the browser what to display the styles for (for example if you want to use different styles for screen display and print).

2. Creating a shortcut icon:

<link rel="icon" href="pic.ico" type="image/x-icon" />


This will cause a picture to show up next to the URL bar, like the infinity symbol for CodeCall.
Life's too short to be cool. Be a nerd.

#5
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
Thanks that helps clear up some of my questions.

I still don't understand why the teacher wants us to use it since we're not using CSS and have no icon. But I guess for sake of using it I could make an icon, and link to that.

Edited by Root23, 25 January 2010 - 10:10 PM.

Posted Image