HTML How to Make a Website Creating HTML Content Include External CSS

PRARTHITA SAHA
PRARTHITA SAHA
1,009 Points

difference between link element and anchor tag

what is the basic difference between link element and anchor tag. I mean in an anchor tag too we are defining the path of an external document and in link to the same.

Desmond Dallas
Desmond Dallas
6,985 Points

The <link> tag defines a link between a document and an external resource. The <link> tag is used to link to external style sheets. whereas, an anchor tags are generally used for links to other websites.

<a> example: For example if you had a section (text) talking about programming on your blog or website. You may place an anchor tag that links to another website or paragraph of that Website that is relevant to the text on your Website or blog.

3 Answers

Steve Gallant
Steve Gallant
14,795 Points

The <link> element is sort of a behind-the-scenes call to load up a resource that the current page needs to be rendered properly. For example, you might link to your CSS style sheet(s) or to publicly available resources like Google fonts, etc. There is nothing to click on, this is just a shorthand way of making those additional references and resources available when the current page loads.

The anchor <a> element, on the other hand, is how you create user-clickable hyperlinks to other pages (or parts of a page), or protocol links like ftp:// or mailto:

Hope this helps!

Steve

A <link> tag is typically used for linking to other documents, such as a CSS stylesheet. Whereas the <a> tag is used to link to an external page, such as <a href="https://www.youtube.com"></a> would take the user to YouTube.

Martha Brown
Martha Brown
4,380 Points

I love that you can make an make an HTML anchor tag to make an img tag into a clickable hyperlink. The title attribute can be a tool tip link.

I learn a lot at the W3C website's W3school.com. They present a variety of tags and demonstrate with interactive examples.