Case Analysis of link tag and a tag in HTML
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!