CSS基础学习

一、背景

CSS 属性定义背景效果:

  • background-color          //背景颜色  十六进制 - 如:"#ff0000" RGB - 如:"rgb(255,0,0)" 颜色名称 - 如:"red"
  • background-image     //背景图像  background-image:url('img_tree.png');
  • background-repeat        //背景图像是否及如何重复  background-repeat:no-repeat; (no-repeat 不平铺 repeat-x 横向平铺 repeat-y 横向平铺)
  • background-attachment //背景图像是否固定或者随着页面的其余部分滚动。
  • background-position      //背景图像定位
background:颜色 图片 平铺  定位;
例:body {background:#ffffff url('img_tree.png') no-repeat right top;}

  background-attachment:scroll; 默认随页面的其余部分滚动   fixed; 背景图像是固定的   inherit; 指定background-attachment的设置应该从父元素继承

主页背景图设置

.bodybg {
100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}

<img src="./images/loginbg1.jpg" class="bodybg">

 二、圆角按钮——CSS

.btn {
99px;
height: 35px;
line-height: 35px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: none;
cursor: pointer;
font-size: 14px;
font-family: "Microsoft Yahei";
color: #fff;
}

原文地址:https://www.cnblogs.com/wuss/p/6632250.html