How to increase HTML page loading speed

How to increase HTML page loading speed

(1) Reduce HTTP requests. (Merge resource files and use image sprites;

(2) Put CSS in the head and JavaScript at the end of the body tag;

(3) Define the width and height of the image;

(4) Define the character set;

(5) Avoid empty src and href attributes,

Write this in html:

 <a href="javascript:;" class="triggerName">Trigger</a>

js is defined as follows:

 $("#triggerName").click(function(e){
            e.preventDefault(); //Cancel the default action of the click event to prevent the link from jumping//
        })

(6) Enable GZIP compression;

(7) Abandon CSS expressions and use more efficient CSS selectors;

(8) Use external CSS and JavaScript;

(9) Compress CSS and JavaScript code;

(10) Reduce redrawing;

The above is the HTML method that I introduced to you to increase page loading speed. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  How to implement image mapping with CSS

>>:  Summary of the process and common problems of connecting VS2019 to MySQL database

Recommend

Let's talk about the characteristics and isolation levels of MySQL transactions

The Internet is already saturated with articles o...

JavaScript pre-analysis, object details

Table of contents 1. Pre-analysis 1. Variable pre...

Mysql online recovery of undo table space actual combat record

1 Mysql5.6 1.1 Related parameters MySQL 5.6 adds ...

VMware Workstation 12 Pro Linux installation tutorial

This article records the VMware Workstation 12 Pr...

jQuery achieves breathing carousel effect

This article shares the specific code of jQuery t...

JavaScript tips to help you improve your coding skills

Table of contents 1. Filter unique values 2. Shor...

MySQL 8.0.18 uses clone plugin to rebuild MGR implementation

Assume that a node in the three-node MGR is abnor...

Three commonly used MySQL data types

Defining the type of data fields in MySQL is very...

How to deploy kafka in docker

Table of contents 1. Build Docker 2. Enter the co...

Why do code standards require SQL statements not to have too many joins?

Free points Interviewer : Have you ever used Linu...

About debugging CSS cross-browser style bugs

The first thing to do is to pick a good browser. ...

Detailed explanation of the JavaScript timer principle

Table of contents 1. setTimeout() timer 2. Stop t...