Get the App
SLTechnology News&Howtos  ›  Development  › 

Case Analysis of link tag and a tag in HTML

Shulou Source: shulou.com Published: 2022-06-01 11:06:31 09月28日 Update

This article introduces the relevant knowledge of "link tag and a tag instance analysis in HTML". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First of all, let's see what the link tag is.

The link tag is the tag used to connect other pages related to the page, but this tag is not directly related to the appearance of the site.

So basically it's written in the head tag.

The link tag is typically used to read CSS and JavaScript as external files, and to read the web icon named favicon.

What is the a label?

When you see the link, someone may think of the a tag.

The a tag defines a hyperlink that is used to link from one page to another.

Let's look at the difference between the link tag and the a tag.

As described in the definition above, the link tag is not directly related to the appearance of the site.

However, the a tag creates a hyperlink element in the page.

If you want to create a basic hyperlink, use the a tag, and if you want to read other files from HTML, use the link tag.

How do I use link tags?

These files can be separated from HTML and saved externally as .css files or .js files.

You need to read the file using the link tag above.

Let's take a look at specific examples.

The code is as follows

HTML

one

two

three

four

five

six

Text

CSS

one

two

three

.text {

Color: blue

}

The running result is as follows

In this way, you can see that the CSS written in style.css is actually successfully connected to HTML through the link tag.

The rel attribute specifies the relationship between this HTML and CSS, and the href attribute specifies the path to the file to be read

How do I use the a tag?

The use of the a tag is very simple. Let's look at a specific example.

one

two

three

four

five

six

seven

eight

nine

Php Chinese website

The running effect is as follows

This is the end of the content of "link tag and a tag instance Analysis in HTML". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Tags files links pages websites examples case analysis analysis between content appearance actual attributes more knowledge examples faceted run practical successful Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL Shulou Technology Docker Shulou Information