" tag."/> " tag.">
Home >Web Front-end >CSS Tutorial >What is a css file generally called?
css files are generally called CSS external style sheets, with the extension ".css". When you copy the CSS style code into a text file and save it as a ".css" file, it is an external style sheet. CSS files can be referenced in HTML through the "@import" keyword or the "2cdf5bf648cf2f33323966d7f58a7f3f" tag.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
css files are generally called CSS external style sheets, with the extension ".css".
CSS External Style Sheet
If the CSS style is placed in a file outside the web document, it is called an external style sheet , a CSS style sheet document represents an external style sheet.
In fact, the external style sheet is a text file with the extension .css. When you copy the CSS style code into a text file and save it as a .css file, it is an external style sheet.
External style sheets must be imported into web documents before they can be recognized and parsed by the browser. External style sheet files can be imported into HTML documents in two ways.
1. Use the 2cdf5bf648cf2f33323966d7f58a7f3f tag to import
Use the 2cdf5bf648cf2f33323966d7f58a7f3f tag to import the external style sheet file:
<link href="001.css" rel="stylesheet" type="text/css" />
For each attribute Description: The
href attribute sets the address of the external style sheet file, which can be a relative address or an absolute address.
The rel attribute defines the associated document, which here indicates that the associated document is a style sheet.
The type attribute defines the type of imported file. Like the style element, text/css indicates a CSS text file.
Generally when defining the 2cdf5bf648cf2f33323966d7f58a7f3f tag, three basic attributes should be defined, among which href is a must-set attribute.
You can also add the title attribute in the link element to set the title of the optional style sheet. That is, when a web document imports multiple style sheets, you can select the style sheet file to be applied through the title attribute value. [Recommended tutorials: CSS Video Tutorial, "html Video Tutorial"]
Tip: In the Firefox browser, you can select "View- -> Page Style" option, and then the title attribute value will be displayed in the submenu. Just select different title attribute values to selectively apply the required style sheet file. IE browser does not support this feature.
2. Use the @import keyword to import
Use the @import keyword in the c9ccee2e6ea535a969eb3f532ad9fe89 tag to import the external style sheet file:
<style type="text/css"> @import url("001.css"); </style>
After the @import keyword, use the url() function to include the address of the specific external style sheet file.
For more programming related knowledge, please visit: Programming Video! !
The above is the detailed content of What is a css file generally called?. For more information, please follow other related articles on the PHP Chinese website!