zoukankan      html  css  js  c++  java
  • css+div盒模型研究笔记

    红色标记的为默认值

    1、border(边框):border-top,border-bottom,border-left,border-right

         1.border-color(边框颜色);

         2.border-width(边框粗细):medium|thin|thick|数值;

         3.border-style(边框样式):none|hidden|dotted|dashed|solid|

    2、padding(内边距):padding-top,padding-bottom ,padding-left,padding-right

    3、margin(外边距):margin-top,margin-bottom ,margin-left,margin-right

    当margin设为负数时,会使被设为负数的块向相反的方向移动,设置覆盖在另外的块上。当块之间是父子子关系时,通过设置子块的margin为负数,可以将字块从父块中分离出来。

    4、background-color:(背景色)

        1.在给元素设置background-color背景色时,IE作用的区域为content+padding,而Firefox则是content+padding+border。
        2.body是一个特殊的盒子,它的背景色会延伸到margin的部分。

    属性的简写形式:

           1.如果给出2个属性值,前者表示上下的属性,后者表示左右的属性。

           2.如果给出3个属性值,前者表示上的属性,中间的数值表示左右的属性,后者表示下的属性。

           3.如果给出4个属性值,依次表示上、右、下、左的属性,顺时针排序。

    元素的分类

    1.块级元素(block):占一行

    块级元素div1和div2之间的垂直margin=MAX(div1的margin_bottom,div2的margin-top)

    2.行内元素(inline)

    行内元素span1和span2之间的水平margin=(span1的margin-right)+(span2的margin-left)

    盒子的浮动:

    1.设置浮动:float:none|left|right

    2.清除浮动:clear:none|left|right|both 

  • 相关阅读:
    UVALive 5983 MAGRID DP
    2015暑假训练(UVALive 5983
    poj 1426 Find The Multiple (BFS)
    poj 3126 Prime Path (BFS)
    poj 2251 Dungeon Master 3维bfs(水水)
    poj 3278 catch that cow BFS(基础水)
    poj3083 Children of the Candy Corn BFS&&DFS
    BZOJ1878: [SDOI2009]HH的项链 (离线查询+树状数组)
    洛谷P3178 [HAOI2015]树上操作(dfs序+线段树)
    洛谷P3065 [USACO12DEC]第一!First!(Trie树+拓扑排序)
  • 原文地址:https://www.cnblogs.com/jingblogs/p/4261486.html
Copyright © 2011-2022 走看看