技海泛舟(个人技术研究)

  • 首页
  • 日积月累
  • 学习计划
  • 随想
  • project
  • 关于
技海泛舟
一个技术宅的博客
  1. 首页
  2. 日积月累
  3. css
  4. 正文

css 基础02

2021年12月4日 1813点热度
  1. css背景
    1)background-color:背景色(transparent、color)
    2)background-image:背景图(none、url)
    3)backgournd-repeat:设置背景图的铺排方式(repeat、no-repeat、repeat-x、repeat-y)
    4)background-position:设置背景图位置({x-number|top|center|bottom} {y-number|left|center|right}),控制背景图片在元素的位置。x轴、y轴。如果只带一个参数,代表纵向为50%。
    5)backgroud-attachment:背景图像滚动方式(scorll|fixed)
    6)background:设置背景图复合写法。

    background:color image repeat attachment position
    body {
    background:#999 url(images/bg.jgp) repeat-x scroll 200px 100px
    }
  2. css伪类选择器
    专门用来表示元素的一种特殊状态
    1)a标签的伪类
    a:link 未访问状态;a:visited已访问状态;a:hover鼠标悬停状态;a:active用户激活状态
    2):focus获得焦点
    input:focus {background-color:yellow;}
    3):first-child选择元素的第一子\元素 :last-child | :nth-child(1number) | nth-of-type(number)
    p:first-child {font-weight:bold}

    p:nth-child(2) 筛选出所有子元素 选择第二个判断是否为p元素 是就把字体设置为#ff0000.
    而p:nth-of-type(2) 先筛选出子元素中的p元素,再选择第二个p元素并把字体设为#55b7dd.

本作品采用 知识共享署名 4.0 国际许可协议 进行许可
标签: 暂无
最后更新:2021年12月6日
< 上一篇
下一篇 >
归档
  • 2024 年 11 月
  • 2024 年 8 月
  • 2024 年 5 月
  • 2024 年 2 月
  • 2023 年 12 月
  • 2023 年 11 月
  • 2023 年 9 月
  • 2023 年 6 月
  • 2022 年 12 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 8 月
  • 2022 年 7 月
  • 2022 年 6 月
  • 2022 年 5 月
  • 2022 年 4 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2022 年 1 月
  • 2021 年 12 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 5 月
分类
  • Android
  • Arduino
  • cordova
  • css
  • go
  • html5
  • JavaScript
  • nodejs
  • oracle
  • project
  • system
  • uni-app
  • vscode
  • vue
  • 学习计划
  • 摘抄
  • 随想

COPYRIGHT © 技海泛舟(个人技术研究). 2021-2023. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

蜀ICP备2026065271号-1

蜀公网安备XXXXX号