CSS beginners: external calling of style sheets

Source: Internet
Author: User
Advantages of external reference
Why should we make the CSS declaration a CSS file? There are three benefits to doing so.
The first advantage is that webpage processing speed is faster, especially when many webpages share a CSS style sheet! Because you don't need to write the same CSS code for each page, the web page will naturally be thinner and lighter.
The second advantage is that it can prevent users with low computer level from directly seeing the CSS syntax (that is, some people do not like the syntax to be seen). Of course, it means that they cannot directly see it, rather than not, it is easy to view the content of a CSS file.
The third benefit is of course easy maintenance! You only need to modify a CSS file. No matter how many thousands of webpage files you have, your latest version will prevail!
Start making CSS files
First, we will remove the <style type = "text/css"> </style> in the original Declaration (these two labels are not required in the CSS file, because, the browser can see that the extension is css and it will know that this is a CSS file.) then, use the notepad program to paste the following code.
Body {font-size: 9pt}
After that, save the token and the extension name of the file is. Css. Save it as style.css and put it in the same directory as the webpage.
Call a CSS file on a webpage
After the CSS file is ready, we should call it on the webpage as follows:
<Head>
<Title> CSS external call example </title>
<Link href = "style.css" rel = stylesheet type = "text/css">
</Head>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.