• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
不见花落
博客园    首页    新随笔    联系   管理    订阅  订阅
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 {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}

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

 

 

 二、圆角按钮——CSS

.btn {
width: 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;
}

 

posted on 2017-03-28 10:07  不见花落  阅读(109)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3