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
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.
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!