CSS Introduction Method:
1. Inline style (inline style/inline style): Written directly in HTML tags
For example:
<p style= "color: #00AFC7; font:arial; " ></p>
2. Internal style: written between head and head
For example:
<style>
CSS Styles
</style>
3. External style: requires reference to take effect
For example:
1>.<link rel= "stylesheet" href= ". /css/123.css "/>
2>[email protected] URL (.. /CSS/123.CSS)
The difference between link and @import:
Difference 1:
Link is the XHTML tag, in addition to loading CSS, you can also define other transactions such as RSS, @import belong to the CSS category, can only load CSS.
Difference 2:
When link is introduced into CSS, it is loaded at the same time when the page is loaded; @import need to load the page when it is fully loaded.
Difference 3:
Link is an XHTML tag, no compatibility issue, @import is proposed in CSS2.1, the lower version of the browser is not supported.
Difference 4:
Link supports using the JavaScript control DOM to change the style, while @import does not support it.
What are the ways CSS is introduced? What is the difference between link and @import?