zoukankan      html  css  js  c++  java
  • HTML5学习日记 --- 4.5日

    5,Css3响应式布局

    媒体类型
      all 所有媒体
      braille 盲文触觉设备
      embossed 盲文打印机
      print 手持设备
      projection 打印预览
      screen 彩屏设备
      speech '听觉'类似的媒体类型
      tty 不适用像素的设备
      tv  电视

    关键字
      and
      not      not关键字是用来排除某种制定的媒体类型
      only     only用来定某种特定的媒体类型

    媒体特性
      (max-600px)
      (max-device- 480px)  设备输出宽度
      (orientation:portrait)  竖屏
      (orientation:landscape)    横屏
       (-webkit-min-device-pixel-ratio: 2) 像素比
      devicePixelRatio 设备像素比 window.devicePixelRatio = 物理像素 / dips

    样式引入
      <link rel="stylesheet" type="text/css" href="../css/print.css" media="print" />
       @import url("css/reset.css") screen;
      @media screen{
            选择器{
           属性:属性值;
           }
         }

    <link rel=”stylesheet” media=”all and (orientation:portrait)” href=”portrait.css”>
    <link rel=”stylesheet” media=”all and (orientation:landscape)”href=”landscape.css”>
    @media screen and (min-400px) and (max-500px) {.box {margin: 0 auto;}}

    <link rel="stylesheet" type="text/css" href="styleA.css"  media="screen and (min- 800px)">
    <link rel="stylesheet" type="text/css" href="styleB.css" media="screen and (min- 600px) and (max- 800px)">
    <link rel="stylesheet" type="text/css" href="styleC.css"    media="screen and (max- 600px)">

        移动端meta

    <meta name="viewport" content="" />
    width [pixel_value | device-height]
    height [pixel_value | device-height]
    user-scalable 是否允许缩放 (no||yes)
    initial-scale 初始比例
    minimum-scale 允许缩放的最小比例
    maximum-scale 允许缩放的最大比例
    target-densitydpi [dpi_value | device-dpi | high-dpi | medium-dpi | low-dpi]

    1,弹性盒模型

    注意在使用弹性盒模型的时候 父元素必须要加display:box 或 display:inline-box
    Box-orient 定义盒模型的布局方向
      Horizontal 水平显示
      vertical 垂直方向
    box-direction 元素排列顺序
      Normal 正序
      Reverse 反序
    box-ordinal-group 设置元素的具体位置

    Box-flex 定义盒子的弹性空间
      子元素的尺寸=盒子的尺寸*子元素的box-flex属性值 / 所有子元素的box-flex属性值的和
    box-pack 对盒子富裕的空间进行管理
      Start 所有子元素在盒子左侧显示,富裕空间在右侧
      End 所有子元素在盒子右侧显示,富裕空间在左侧
      Center 所有子元素居中
      Justify 富余空间在子元素之间平均分布

    box-align 在垂直方向上对元素的位置进行管理
      Star 所有子元素在据顶
      End 所有子元素在据底
      Center 所有子元素居中

    2,盒模型阴影

    用法
    box-shadow:[inset] x y blur [spread] color
    参数
      inset:投影方式
      inset:内投影
      不给:外投影
      x、y:阴影偏移
      blur:模糊半径
      spread:扩展阴影半径
      先扩展原有形状,再开始画阴影
      color

    3,其他盒模型新增属性

    box-reflect 倒影
      direction  方向     above|below|left|right;  
      距离
      渐变(可选)
    resize 自由缩放
      Both 水平垂直都可以缩放
      Horizontal 只有水平方向可以缩放
      Vertical 只有垂直方向可以缩放
      注意:一定要配合overflow:auto 一块使用只有水平方向可以缩放

    box-sizing 盒模型解析模式
      Content-box  标准盒模型 width/height=border+padding+content
      Border-box 怪异盒模型 width/height=content

    4,Css3分栏布局

    column-width 栏目宽度
    column-count 栏目列数
    column-gap   栏目距离
    column-rule  栏目间隔线

  • 相关阅读:
    021.day21 反射 Class类 反射常用操作
    020.day20 线程概述 多线程优缺点 线程的创建 线程常用方法 生命周期 多线程同步
    019.day19 缓冲流 对象流 标准输入输出流
    018.day18 map集合如何实现排序 File类 IO流 字节流 字符流 编码
    017.day17 Map接口 克隆 treeSet集合排重缺陷
    016.day16 HashSet TreeSet 比较器Comparable Comparator
    015.day15
    014.day14
    013.day13
    线程
  • 原文地址:https://www.cnblogs.com/dh2608/p/5354790.html
Copyright © 2011-2022 走看看