CSS Beginners: External calls to style sheets

Source: Internet
Author: User
css| style Sheet

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.

BODY{FONT-SIZE:9PT}

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" >


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.