This article mainly introduces some suggestions for writing high-performance HTML applications, including related CSS and JavaScript programming methods. Friends who need it can refer to how you can improve web performance?
Most developers will optimize through JavaScript and images, zip files and merge files through server configuration, zip files and even tweak CSS (merge small images).
Poor HTML is always ignored, even though it has always been the core language of the web.
HTML is getting bigger and bigger. The top 100 websites are mostly around 40K per HTML page. Amazon and Yahoo use thousands of HTML pages. On the youtube.com main page, there are up to 3500 HTML elements.
Reduced HTML complexity and the number of elements of a page do not significantly improve parsing time - but HTML is a key factor in building fast web pages, adapting to different devices and affecting success.
In this article, you will learn how to write clean and clean HTML that enables you to create websites that quickly load and support multiple devices that will be easy to debug and maintain.
There is not only one way to write code - especially HTML. This is just an explanation of general experience, but it is not the only right choice.
HTML, CSS and JavaScriptHTML is a markup language used to represent structure and content.
HTML should not be used to display styles and styles. Don't write text in the title tag (h1~h6) to appear larger, or just use the blockquotes element for indentation. Instead, use CSS to change the appearance and layout of elements.
The default appearance of HTML elements is implemented through the browser's default style: Firefox, Internet Explorer, and Opera are all different. For example, in Chrome, the default h1 element renders to a size of 32px.
Three basic principles:
Using HTML to represent structures, CSS is used to express different styles and themes. JavaScript to respond to user behavior.
Use HTML, use CSS if necessary, and add JavaScript if you are not allowed. For example: In many cases, you might use HTML forms for verification and use CSS or SVG to implement animation.
Separate CSS and JavaScript from your HTML code. Let them be cached, which makes the code easier to debug. In production, CSS and JavaScript are compressible and merged and should be part of your Build system. Note* See JavaScript construction (editing) system competition
Document Document Structure
Using HTML5's document type:
XML/HTML Code Copy content to clipboard