You can connect an external CSS file to an HTML5 document by using the tag in the <head> section of the HTML document: Create a CSS file with a .css extension, such as styles.css. Within the <head> section of your HTML document, add a tag that points to the location of the CSS file, for example: . In the CSS file,
How to use HTML5 to connect CSS
Introduction:
CSS (Cascading Style Sheets) is used to add style and layout to HTML documents. In order to use CSS, it needs to be concatenated into an HTML file. This article explains how to connect CSS in HTML5.
Steps:
.css
is the extension. For example, styles.css
. <head>
section of the HTML document, use <link>## The # tag references a CSS file. The
<head> section is located at the top of the document, before the
tag.
<code class="html"><head> <title>我的页面</title> <link rel="stylesheet" href="styles.css"> </head></code>
<code class="css">body { font-family: Arial, sans-serif; font-size: 16px; }</code>
Tip:
tags in the
<head> section.
The above is the detailed content of How to connect html5 to css. For more information, please follow other related articles on the PHP Chinese website!