CSS (Cascading Style Sheets) is a technology used to design and beautify HTML pages. CSS styles can be created and referenced through the tag within an HTML document or from an external CSS file. </p> <p>The following is a detailed introduction to how to write CSS styles in HTML pages: </p> <ol><li>Embedded <br>Embedded refers to embedding CSS styles directly into HTML pages, using < The ;style> tag wraps CSS code. For example: </li></ol><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>内嵌式CSS样式表</title> <style> body { background-color: #f0f0f0; font-family: Arial, sans-serif; } h1 { color: #333; text-align: center; } 欢迎来到我的网站 这是一段普通的文字