Advantages:
1. The style sheet only affects one page.
2. Internal style sheets can use classes and IDs.
3. No need to upload multiple files. HTML and CSS can be in the same file.
Disadvantages:
1. Increase page loading time.
2. It only affects one page – useless if you want to use the same CSS on multiple documents.
External Style Sheets
Like HTML files, CSS files are plain text and usually have a .css file extension; Link it into the HTML file.
Features:
1), written in a separate document and then attached to various web documents
2), modifying it can affect all your Called page
3), easy to modify operations
For example, the content of the style.css file can be as follows:
body { background-color: beige; color: #000080;} h1 { color: red;}
Then you can use it in the header to take effect.
Advantages:
1. The size of the HTML page is smaller and the structure is clearer.
2. The loading speed is faster.
3. The same .css file can be used on multiple pages.
Cons:
The page may not render correctly until the external CSS is loaded.
The above is how to embed css into html? For more details, please pay attention to other related articles on 1024programmer.com!