<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>selector-class.html</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<!--
CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明。
selector {declaration1; declaration2; ... declarationN }
每条声明由一个属性和一个值组成。selector {property: value},如果值为若干单词,则要给值加引号。
如果要定义不止一个声明,则需要用分号将每个声明分开。
通配符选择器:CSS2 引入了一种新的简单选择器 - 通配选择器(universal selector),显示为一个星号(*)。该选择器可以与任何元素匹配,就像是一个通配符。
CSS 元素选择器:最常见的 CSS 选择器是元素选择器。换句话说,文档的元素就是最基本的选择器。
选择器的分组:可以对选择器进行分组,被分组的选择器就可以分享相同的声明。用逗号将需要分组的选择器分开。
xml文件引入css:<?xml-stylesheet type="text/css" href="note.css"?>
-->
<style type="text/css">
* {
color: red;
}
h1, h2, h3 {
color: gray;
background: white;
padding: 10px;
border: 1px solid black;
font-family: Verdana;
}
</style>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
</body>
</html>