css1

作用:将内容与样式控制分离

写法(两种)

  1.在<head>中先写<style type=text/css>在style中写样式

#是id名    . 是class名  也可以直接写标签名

       2.建立一个文件,在文件里写一个,.css文件,里面写各种样式规范

要引用这种样式也有两种方法{

1.<style>  里写  import“css/a.css”

2.head里写<link rel="stylesheet"  herf="css/a.css">

}

css写法

选择器{

属性名:属性值;

。。。。

}

选择器:

1.#id选择器

2.元素选择器

3.类选择器(class)

例:

1: #ment{                                  
width:50%;

background: burlywood;
height: 300px;
float:left;
}
3: .find{
background: hotpink;
}
2: div{
colour=green;
}


posted @ 2022-03-18 10:26  菜鸟是如何练成的  阅读(38)  评论(0)    收藏  举报