<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-
8">
<link rel="stylesheet" type="text/css" href="my.css">
</head>
<body>
<span class="style1">新闻一</span>
<span class="style1">新闻二</span>
<span class="style1">新闻三</span>
<span class="style1">新闻四</span>
<span class="style1">新闻五</span>
</body>
</html>
CSS 文件:
/*.style1 就是类选择器*/
.style1{
font-weight: bold;
font-size:20px;
background-color: pink;
}
ID 选择器
基本用法:
#id 选择器名{
属性名:属性值;
}
实例: