Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the frequently asked questions in Html learning?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points of Html learning common questions, which are detailed and logical. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Pay attention to Html study:

The character set specified in the HTML file must be the same as the character set in which the file is saved, otherwise there will still be garbled code.

Therefore, just specifying a character set does not necessarily solve the garbled problem. When a file needs to be saved, the saved format of the file must be consistent with the specified character set to ensure that there is no garbled problem.

HTML tag

HTML tag classification

Single label

Only the start tag has no end tag, that is, it is made up of one

Double label

There are start tags and end tags, that is, one and one.

HTML tag relationship classification

Juxtaposition relationship (Brotherhood / equality)

Nested relationship (parent-son / parent / subordinate)

DTD document declaration

What is an DTD document declaration?

Because HTML has many versions of specifications, there are some differences between each version of the specification. So in order for the browser to compile / parse / render our web page correctly, we need to tell the browser in the first line of the HTML file which version of the HTML specification is used to write our current web page. As long as the browser knows which version of the specification we are using, it will be able to compile / parse / render our web page correctly.

DTD document declaration format:

Note:

It can run without writing.

H5 web page can also be run with H4.

The declaration must be the first line of the HTML document, before the tag

The declaration is not a HTML tag

The declaration does not have a closing tag

The declaration is not case-sensitive

This declaration will be viewed by the browser, but it is not entirely dependent on the declaration. The browser has its own default processing mechanism.

Before HTML5, there were two major specifications, and there were three minor specifications in each specification.

Big norms and small norms

HTML Strict (strict)

HTML Transitional (excessive, ordinary, loose)

HTML Frameset (pages with frames)

XHTML Strict (strict)

XHTML Transitional (excessive, ordinary, loose)

XHTML Frameset (pages with frames)

What is the difference between HTML's DTD document declaration and XHTML's DTD document declaration?

XHTML itself stipulates that tags must be lowercase, strictly closed, attributes must be enclosed in quotation marks, and so on, while HTML will be looser and less strict.

Strict says it is strict, and the requirements in this model are more stringent. This strictness is mainly reflected in the fact that some tags cannot be used.

For example, font tag / u tag, etc.

Font tags can modify the font size, color and font of a text, but this conflicts with the nature of HTML, because HTML is only responsible for semantics, not style, and font tags are used to modify styles, so font tags cannot be used in Strict.

U tags can underline a text, but this conflicts with the nature of HTML, because HTML is only responsible for semantics, not styles, while u tags are used to underline styles. Therefore, u tags cannot be used in Strict.

Transitional means ordinary, but there are no other requirements for this model.

For example, you can use font tags, u tags, etc.

But these tags will not be used in enterprise development, because it goes against the nature of HTML, but uses these tags as hooks for css

Frameset represents a frame, which is used on the page of the frame

We will learn more about the framework / NodeJS later.

The common types of DOCTYPE are as follows

Cross-platform development course 02mi-know HTML

With so many norms, which one is more appropriate for us to use in the learning process?

Www.baidu.com (B)

Www.taobao.com (A)

Www.qq.com (T)

Www.sohu.com (wonderful work)

Whether it is HTML or XHTML, most of the documents used in enterprise development in the past are Transitional type document declarations.

But the era of HTML5 has come, the above 6 specifications are only for understanding, and later they are all declared in HTML5 type documents, HTML5 is backward compatible (ask for the shadow area of WC3 at the moment)

At present, the domestic first-tier websites have updated the document statement of HTML5, so the subsequent lectures will also use the document statement of HTML5 throughout the course.

The difference between HTML, XHTML and HTML5

In the early development of HTML, most of the standards were the so-called retro-spec, that is, there were standards after implementation. In this case, the HTML standard is not very standard, and browsers are quite tolerant of errors in HTML pages. This in turn causes HTML developers to write a large number of HTML pages with errors.

Html language itself has some defects (for example, content and form can not be separated; single label; data can not be reused, etc.). With the rise of xml, people want xml to make up for the shortcomings of html, but at present, thousands of web pages are written in html, so it is too early to completely use xml to replace html, so W3C launched xhtml1.0 in 2000. The purpose of establishing xhtml is to achieve the transition from html to xml.

In order to standardize HTML,W3C and XML, XHTML 1.0 standard is developed. This standard does not add any new tags, but only standardizes HTML according to the requirements of XML, and defines a new MIME type application/xhtml+xml. The original intention of W3C is to require browsers to perform strong error checking on this MIME type, and to display an error message if there is an HTML error on the page. However, due to a large number of errors in existing web pages, many developers refuse to use the new MIME type. W3C had no choice but to add an appendix C to the XHTML 1.0 standard, which allows developers to use XHTML syntax to write pages, while using the old MIME type,application/html to distribute pages

The W3C subsequently removed Appendix C in XHTML 1.1, even though pages using the XHTML 1.1 standard must be distributed with the new MIME type. So this standard is not adopted by many people.

With the lessons of XHTML, the W3C made backward compatibility a very important principle when developing the next generation of HTML standards (HTML5). HTML5 does introduce many new features, but one of its most important features is that it does not break existing web pages. You can change the first line of any existing web page to a HTML5 page, and it can still be displayed normally in the browser.

In short

HTML syntax is very loose and fault tolerant.

XHTML is more stringent, requiring tags to be lowercase, strictly closed, attributes in tags must be enclosed in quotation marks, and so on.

HTML5 is the next version of HTML, so in addition to being very loose and fault tolerant, many new features have been added.

Differences between .htm and .html extensions

Only suffixes of length 3 are supported under DOS operating system (win95 or win98), so it is htm

However, the length of the windows suffix can be longer than 3 digits, so it doesn't matter under windows that htm and html,html are named for the format of long files.

So htm exists to be compatible with past DOS naming formats.

These are all the contents of this article entitled "what are the frequently asked questions in Html Learning?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report