css| Skills | tutorials
Previous section: sub-item declaration
Advantages of external references
Why do you want to make CSS declarations into a CSS file? There are three advantages to doing this.
The first benefit is that Web processing can be faster, especially if you have a lot of web pages sharing a CSS style sheet! Because you don't have to write the same CSS code for every page, the page will naturally be thinner and lighter.
The second advantage is that you can prevent some computer-less users from seeing the CSS syntax directly (someone who doesn't like to see the syntax), and of course you can't see it directly, rather than being able to see it, and being a little bit capable, looking at the contents of the CSS file is a breeze.
The third benefit is, of course, easy to maintain! You only need to modify a CSS file, no matter you have thousands of Web page files, will be your latest modified version of the standard!
Start doing CSS files
First, we will remove the <style type= "Text/css" from the original declaration (CSS file does not need these two tags, because the browser to see the extension as CSS to know that this is a CSS file), Then use the Notepad program to paste the following code past.
It is then saved with the file name extension. css, which can be saved as style.css and placed in the same directory as the Web page.
Calling a CSS file in a Web page
After doing the CSS file, we should call it in the Web page, and the method called is as follows:
<title>css External Call Example </title> <link href= "style.css" Rel=stylesheet type= "Text/css" >
|
It's easy! Oh! We will be in the future article step-by-Step in-depth introduction! Please continue to pay attention to the Web teaching network, our website is: http://www.webjx.com
Next section: using separately