CSS

什么是CSS?

 

    <!--导入外部样式表-->
    <link rel="stylesheet" type="text/css" href="css01.css"> 

CSS颜色表示

.in{
    position: absolute;
    left: 500px;
    top: 20px;
}

 

 

绝对单位

相对单位

文件属性

 

CSS符号属性

CSS背景样式

background-attachment: fixed;

background-position: 20% 30%;

X(body宽度-图片宽度)*20%
Y(body高度-图片高度)*30%

background-size: 100%

CSS链接样式

 

CSS框线

 

 CSS选择器

 子类选择器

div>p{
  color: green
}

属性选择器

a[target]{
  color: green;
}

a[target="_blank"]{
  color: yellow;
}

a[href^="https"]{
  color: red;
}

组合选择器

.demo01{
    position: absolute;
    top: 150px;
    left: 400px;
    width: 285px;
    height: 180px;
    padding: 3px;
    background-color: gray;
    font-family: 微软雅黑;
    font-size: 18px;
    color: navy;
    line-height: 30px;
    border: solid 1px gray;
}
.demo01>.img{
    width: 285px;
    height: 150px;
}
.demo01:hover{
    background-color: white;
    border: solid 1px navy;
    color: darkred;
}
.demo02>.img{
    width: 285px;
    height: 150px;
    overflow: hidden;
}
.demo02>.img>img{
    cursor: pointer;
    transform: all 0.6;
}
.demo02>.img>img:hover{
    transform: scale(1.4);
}
View Code
.input form input:focus{
    background-color: cornflowerblue;
}

 

 

 外边距的纵向合并

margin越界

 

 盒子模型绘图

 

posted on 2019-02-28 20:51  StevenRen  阅读(95)  评论(0)    收藏  举报

导航