第一个CSS程序
- index.html
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>title</h1>
</body>
- css.style
/*
css语法:
选择器{
声明1;
声明2;
}
*/
h1{
color:red;
}
基本选择器
- 标签选择器
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
h1{
color:darkcyan;
}
</style>
</head>
<body>
<h1>java</h1>
</body>
- 类选择器
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.java{
color:darkcyan;
}
</style>
</head>
<body>
<h1 class="java">java</h1>
</body>
- id选择器
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#java{
color:darkcyan;
}
</style>
</head>
<body>
<h1 id="java">java</h1>
</body>
标签:darkcyan,java,Title,color,选择器,CSS
From: https://www.cnblogs.com/benny1799/p/16981391.html