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

How to use HTML correctly

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

Share

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

This article introduces the knowledge of "how to use HTML correctly". In the operation of actual cases, many people will encounter such a dilemma. Next, 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!

HTML code convention

Web developers are often uncertain about the code styles and syntax used in HTML.

Between 2000 and 2010, many web developers converted from HTML to XHTML.

With XHTML, developers have to write effective "well-formed" code.

HTML5 is a little more relaxed when it comes to code validation.

With HTML5, you must create your own best practices, style guides, and code conventions.

Smart and guaranteed for the future.

The logical use of styles can make it easier for others to understand and use your HTML.

In the future, programs such as XML readers may need to read your HTML.

You can be smarter by using a well-formed "approximate XHTML" syntax.

Note: please always keep your style smart, clean, clean and well-formatted.

Please use the correct document type

Always declare the document type on the first line of the document:

If you always insist on lowercase tags, you can use:

Please use lowercase element names

HTML5 allows mixed uppercase and lowercase letters in element names.

We recommend using lowercase element names:

Mixed case names are not good developers are used to using lowercase names (such as in XHTML) lowercase is cleaner and easier to write

Not so good:

This is a paragraph.

It's bad:

This is a paragraph.

Not bad:

This is a paragraph.

This is the end of "how to use HTML correctly". 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!

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