Css笔记(Cascading style sheets)
选择器{属性:值;属性:值;属性:值;}
直接插入
<head>
<style type="text/css">
input{font-size:20;color:red}
</style>
</head>
引用
H1{color:red;text-size:34}
<head>
<link rel=” stylesheet” type=”text/css” href=”文件”>
</head>
样式类:
元素可以通用
.bluebig
{和type的属性一样}写在css
Class=”bluebig”写在html
元素id:
特定元素指定特定的样式
#aa
{和type的属性一样}写在css
id=”bluebig” 在html
伪类:
页面中处于某种特定状态定义一个样式
链接的样式
1、a:link { font-size: 14pt; text-decoration: underline; color: blue; }
设置 a 对象在未被访问前的样式。
2、a:hover { font-size: 14pt; text-decoration: underline; color: blue; }
设置对象在其鼠标悬停时的样式
3、a:active { font-size: 14pt; text-decoration: underline; color: blue; }
设置对象在被用户激活(在鼠标点击与释放之间发生的事件)时的样式。
4、a:visited { font-size: 14pt; text-decoration: underline; color: blue; }
设置 a 对象在其链接地址已被访问过时的样式。
分类:
h1.s1
{和type的属性一样}
h1.21
{和type的属性一样}
在html引用:<h1 class=”s1”></h1>选择了第一个样式
选择:
B h1{和type的属性一样}被包含在b内的h1的颜色
在html中<b><h1>包含在里的颜色</h1><b>
框模型
Margin外边际
Padding 内边际