Home >Web Front-end >HTML Tutorial >How to import js css files
How to import js css files?
External style sheet
When styles need to be applied to many pages , an external stylesheet would be ideal. With external style sheets, you can change the look of your entire site by changing one file. Each page links to the style sheet using the 2cdf5bf648cf2f33323966d7f58a7f3f tag. 2cdf5bf648cf2f33323966d7f58a7f3f tag in the head (of the document):
<head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head>
The browser will read the style declaration from the file mystyle.css and format the document according to it.
External style sheets can be edited in any text editor. The file cannot contain any html tags. Style sheets should be saved with a .css extension.
Multiple style priorities
Style sheets allow style information to be specified in multiple ways. Styles can be specified in individual HTML elements, in the header element of an HTML page, or in an external CSS file. You can even reference multiple external stylesheets within the same HTML document.
Generally, the priority is as follows:
Inline style) Inline style > (Internal style) Internal style sheet > (External style) External style sheet > Browse Server Default Style
Scripts in HTML must be between the 3f1c4e4b6b16bbbd69b2ee476dc4f83a and 2cacc6d41bbb37262a98f745aa00fbf0 tags.
Scripts can be placed in the 6c04bd5ca3fcae76e30b72ad730ca86d and 93f0f5c25f18dab9d176bd4f6de5d30e sections of the HTML page.
External JavaScript
You can also save scripts to external files. External files often contain code used by multiple web pages.
The file extension for external JavaScript files is .js.
If you need to use an external file, please set the .js file in the "src" attribute of the 3f1c4e4b6b16bbbd69b2ee476dc4f83a tag:
<!DOCTYPE html> <html> <body> <script src="myScript.js"></script> </body> </html>
You can place the script in the 93f0f5c25f18dab9d176bd4f6de5d30e or < ;body>, the script placed in the 3f1c4e4b6b16bbbd69b2ee476dc4f83a tag runs exactly the same as the externally referenced script.
The above is the detailed content of How to import js css files. For more information, please follow other related articles on the PHP Chinese website!