Omit the protocol of resource files
It is recommended to omit the protocol part (http:, https:) in the URL of pictures, media files, styles and scripts. Omit the protocol. After the section, the resource file will inherit the protocol of the page URL. Not only can it prevent the problem of mixed content, but it can also reduce the size of the page. For example: referencing a JavaScript file can be written in the following recommended way.
Why are h4, h5, and h6 tags rarely used?
Title tags include h1 to h6. We commonly use h1, h2, h3, but rarely use h4, h5, and h6.
In a website that is reasonably semantic and dares to run naked (without using CSS for layout), in addition to being semantic, the title tag also has some styling effects. But today when CSS is popular, using h1 and h6 actually has no effect. There is a big difference, anyway, the appearance can be used casually. As a title tag,
has more powerful functions. The title element means the keyword with high weight on the page, so h1, h2 and h3 are frequently used. To weight keywords. The weights of h4, h5 and h6 are not high, not even as good as strong and em, so they are rarely used. It is estimated that their authority level is as follows:
h1 > h2 > h3 > strong > em > h4 > h5 > h6
When to use thead, tbody or tfoot?
I originally thought of thead as The header is used to place the table title unit, such as th; while tbody is used to place the table content, and tfoot is the table description. In fact, my understanding is not quite correct. These tags are actually dispensable.
Because the browser generally needs the entire table to be downloaded before it starts to display, which affects the user's reading in the era of table layout. Therefore, these tags are used to divide the table into multiple table parts, and the downloaded part can be displayed. In addition, Also in order to print long tables, the header and footer can appear on each page.
Omit the optional tags
Used Dreamwave Students should have the impression that when you create an HTML file, the default code is as follows.
<html> <head> </head> <body> </body> </html>
We will put the title, external CSS and JavaScript references in the head area and display them on the page The content is placed in the body, but in fact html, head and body are all omissible tags.
After deleting these optional tags, it looks strange, but the page displays normally and the W3C test can pass . I have already done this on my blog. But one thing to note is that if you want to write the page in XHTML, then please keep the html tag, because you still need the following code as a statement.
<html xmlns="http://www.w3.org/1999/xhtml">
b tag and i tag
Many people think that the b tag and i tag have the same fate as the u tag, and are classified as "tags not recommended" by W3C. But In the HTML5 specification, the use of these two tags is still recommended. I have always been aware of this and even argued with my friends about it. But I have never understood how to define them in HTML5.
hr tag
hr is a line, a horizontal line that divides content. I have always thought that hr is a crappy thing. It is useless to see whether the drawn line can be processed with CSS. In fact, hr is in Semantically, it is the dividing line of the article, completely dividing the context of the article, making them irrelevant.
Its function is like the dividing line in the figure below that appears in many blog posts, except that hr is semantically The same is true on the page, and crawlers can also understand it.
Why are we used to using a tags to make buttons?
It’s not input type="button". I understand, because the hover effect cannot be seen in lower versions of IE. But why is it a tag instead of span? The a tag is made into a button without href. Is this right? I haven't thought about it yet. It used to be like this Doing it is like a conditioned reflex.
Afterword
Google's HTML/CSS coding style guide is a short and concise suggested code writing The manual is very useful, but please don’t be superstitious. There is an item in it that recommends using two spaces for indentation. This may not be feasible in many teams. Our team still uses tabs.
In this manual Many HTML suggestions are aimed at HTML5, but here we use HTML style instead of XHTML style. In many places, the omission of code actually weakens the readability of the code. Everyone should make a judgment on their choice.
For more relevant articles and suggestions on writing style of HTML code, please pay attention to the PHP Chinese website!

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools