In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail the "case analysis of the use of HTML", with detailed contents, clear steps and proper handling of details. I hope that this article "case analysis of the use of HTML" can help you solve your doubts.
First create a new file using the VSCode editor and save the file's extension to .html or .htm, such as MyFirstHTML.html. Then, type HTML:5 in the file and select according to the contents of the prompt box.
We get the most basic content of this version of HTML5! How's it going? It's easy enough.
Of course, now we don't know what's written in it, don't worry ~ next, let's learn about it one by one!
First of all, what catches our eyes is. It is called a HTML declaration, and it mainly tells the browser what the version of the HTML document is, so that the browser can parse and load accurately.
But then again, today's browsers are already very powerful. In other words, browsers can parse and load well even if you don't write a HTML declaration when you write an HTML document. If you don't believe me, let's look at an example:
Then, let's run the HTML document in the browser and see what the result is.
As you can see, after running the HTML document, there are no display problems. But, but, I still want to tell you, try to add the HTML statement! Although HTML is a nice girl, it doesn't mean you can do whatever you want, right?
With less gossip, let's continue to introduce the HTML statement. The declaration in the first example belongs to the HTML5 version. In other words, the HTML4 version, no, the declaration of the HTML4.01 version is different from the HTML5 version.
The HTML4.01 version has a total of three declarations, the most common of which is the following:
In this basic structure, with the exception of the HTML declaration, everything else we can call elements. For example, the example we completed earlier:
We can clearly see that an element contains tags and content, and tags can be divided into start tags and end tags. Of course, an element doesn't have to have a start tag and an end tag, sometimes it's just a start tag. This is because elements can be divided into two categories:
The element we see above is a closed element because it has a start tag and a closing tag. In the basic structure of HTML, we can find the element, which is an empty element because it has only the start tag, not the end tag.
Tag signatures, which you want to mix in lowercase, uppercase or uppercase, are OK, such as, or. This is because HTML is size-insensitive, but the W3C recommendation is lowercase, and today's editors basically provide lowercase. You don't have to worry too much about it. I just want to let you know.
In addition to tags and content, an element can actually define attributes in the opening tag. Attributes are used to define some additional information for an element, such as name, style, ID, and so on.
At this point, you might ask, why are attributes defined in the opening tag, not in the closing tag? As we said earlier, there are two kinds of elements: closed elements and empty elements. Both closed and empty elements have a start tag, but an empty element does not have a closing tag. If you define attributes in the closing tag, you are obviously bullying other people's empty elements. He is already a single dog, but you have to abuse him. It's so inhumane!
The attribute of an element also has two parts: the attribute name and the attribute value, which, like a couple, cannot be separated. Of course, there are exceptions to everything, and there are those that have the same attribute name and attribute value, which allows you to define only the attribute name. Such as the following:
We can see that the property disabled can only define the property name, because it is only disabled. This is a relatively special attribute, and there are not many of them in HTML.
In addition, according to the function, the attributes of elements can be divided into four categories:
After understanding the elements and attributes in HTML, let's go back to the basic structure of HTML generated before, and a lot of it will be clear at this time. But there are still some things that need to be introduced to you.
For example, we can see that in addition to the HTML declaration, there is an element called the root element, which is generally called the root element because all other elements are in it. And only one element can be defined in an HTML document, and even if you define multiple elements in an HTML document, the browser parses only one of them.
For example, the content displayed in the browser window is defined in this element. Even if you define a specific element directly without writing the basic structure of HTML, the browser will automatically put the element in the element after running it in the browser.
Next, there is another very important element, that is. This element is used to define the information of the HTML document. For example, the first HTML defines the title of the HTML document as the first HTML.
After reading this, the article "case Analysis of HTML usage" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.