The tag links the CSS style file to the HTML file to take effect."/> The tag links the CSS style file to the HTML file to take effect.">

Home >Web Front-end >CSS Tutorial >How to write css external style sheet

How to write css external style sheet

anonymity
anonymityOriginal
2019-05-28 09:43:2830032browse

External css style (also called external style) is to write the css code in a separate external file. This css style file has the extension name ".css" and is in 93f0f5c25f18dab9d176bd4f6de5d30e (not in < ;style> tag) use the 2cdf5bf648cf2f33323966d7f58a7f3f tag to link the css style file to the HTML file, as shown in the following code:

de5e14f9557c8e312229be0d6d83d783

Note:

1. The css style file name is named with meaningful English letters, such as main.css.

2. rel="stylesheet" type="text/css" is a fixed writing method that cannot be modified.

3. The 2cdf5bf648cf2f33323966d7f58a7f3f tag position is generally written within the 93f0f5c25f18dab9d176bd4f6de5d30e tag.

How to write css external style sheet

Example:

style.css

span{
   color:red;
   font-size:20px;
}

index.html

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>嵌入式css样式</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <p>php中文网,<span>超酷的互联网</span>、IT技术免费学习平台,创新的网络一站式学习、实践体验;<span>服务及时贴心</span>,内容专业、<span>有趣易学</span>。专注服务互联网工程师快速成为技术高手!</p>
</body>
</html>

The above is the detailed content of How to write css external style sheet. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn