What is the format of a document-level style sheet, and where does the sheet appear?
时间: 2023-11-22 22:56:14 浏览: 41
A document-level style sheet is written in CSS (Cascading Style Sheets) and is used to define the visual appearance and layout of a web page. It includes rules that specify how HTML elements should be displayed, such as font size, color, background color, and spacing.
The format of a document-level style sheet is as follows:
```
<!DOCTYPE html>
<html>
<head>
<style>
/* CSS rules go here */
</style>
</head>
<body>
<!-- HTML content goes here -->
</body>
</html>
```
The `<style>` tag is used to enclose the CSS rules, which are written between curly braces `{}`. The rules are written in the form of `property: value` pairs, and each rule is separated by a semicolon `;`.
The document-level style sheet appears within the `<head>` section of an HTML document, between the `<head>` and `</head>` tags. This ensures that the styles are loaded before the content of the page, allowing the browser to display the content in the correct style.