HTML 4 HTML (not XHTML), MIME type is text/html, some tags are allowed to be omitted. With HTML 4 DTD, you can omit the following tags (the so-called avoidable elements are marked with strikethrough):
For example, if your code is It can be written as For example, paragraphs should be At the end, you can just write You can even remove html, head, and body (make sure you are comfortable with this before making it your coding standard). Omitting the tags will keep the HTML valid while reducing the file size. For typical pages, this can save 5-20%. HTML 5 The ongoing development of HTML 5 provides some methods to reduce file size. For example, the page document type declaration contrast Obviously HTML 5's DTD is shorter. When specifying the encoding for a page, HTML 5 is easier to use and shorter: replace Normally, browsers process HTML correctly. Additionally, in today's HTML 5, you can remove the type attribute that declares the MIME type, such as or You can use Alternative use Alternative In all types of pages (even XHTML) you can omit HTML 5 makes this easier. Using all of the above techniques together can save 10%-20% (or even more) of your file size, depending on your coding style and the amount of text in your page. The code will be cleaner and visitors will get to your site content faster. We used many of these techniques in the Privacy Center project, saving 20% of the original file size. |
<<: JavaScript to implement a simple clock
webpack-dev-server core concepts Webpack's Co...
Browser compatibility is the most important part ...
In the process of learning CSS3, I found that man...
Table of contents Preface: 1.Brief introduction t...
Preface I accidentally discovered that the half-h...
1. Install JDK 1.1 Check whether the current virt...
Table of contents 1. Job Execution Fault Toleranc...
1. Install ffmpeg under centos linux 1. Download ...
hash mode (default) Working principle: Monitor th...
Table of contents 1. How are structures stored in...
MySQL error: Parameter index out of range (1 >...
Table of contents Functional Components How to wr...
<br />In the first section of this series, w...
Related articles: Beginners learn some HTML tags ...
Uninstall the old version of MySQL (skip this ste...