position 和 display 的取值和各自的意思和用法

position
    1、position属性取值:static(默认)、relative、absolute、fixed、inherit。
    2、postision:static;始终处于文档流给予的位置。看起来好像没有用,但它可以快速取消定位,让top,right,bottom,left的值失效。在切换的时候可以尝试这个方法。
    3、除了static值,在其他三个值的设置下,z-index才会起作用。(确切地说z-index只在定位元素上有效)
    4、position:relative和absolute都可以用于定位,区别在于前者的div还属于正常的文档流,后者已经是脱离了正常文档流,不占据空间位置,不会将父类撑开。定位原点relative是相对于它在正常流中的默认位置偏移,它原本占据的空间任然保留;absolute相对于第一个position属性值不为static的父类。所以设置了position:absolute,其父类的该属性值要注意,而且overflow:hidden也不能乱设置,因为不属于正常文档流,不会占据父类的高度,也就不会有滚动条。
    5、position:fixed 旧版本IE不支持,定位原点相对于浏览器窗口,而且不能变。常用于header,footer,或者一些固定的悬浮div,随滚动条滚动又稳定又流畅,比JS好多了。fixed可以有很多创造性的布局和作用,兼容性是问题。
    6、position:inherit。规定从父类继承position属性的值。但是任何版本的IE都不支持该属性值。


    display
    1、display属性取值:none、inline、inline-block、block、flex、inherit。
    2、display属性规定元素应该生成的框的类型。文档内任何元素都是框,块框或行内框。
    3、display:none和visiability:hidden都可以隐藏div,区别有点像absolute和relative,前者不占据文档的空间,后者还是占据文档的位置。
    4、display:inline和block,又叫行内元素和块级元素。表现出来的区别就是block独占一行,在浏览器中通常垂直布局,可以用margin来控制块级元素之间的间距;而inline以水平方式布局,垂直方向的margin和padding都是无效的,大小跟内容一样,且无法设置宽高。inline就像塑料袋,内容怎么样,就长得怎么样;block就像盒子,有固定的宽和高。
    5、inline-block就介于两者之间。
    6、display: flex 意为"弹性盒布局模型",用来为盒状模型提供最大的灵活性。任何一个容器都可以指定为flex布局。设为Flex布局以后,子元素的float、clear和vertical-align属性将失效。采用flex布局的元素,称为flex容器。它的所有子元素自动成为容器成员,称为flex项目(flex item)。
    容器的属性:以下6个属性设置在容器上。
        flex-direction    决定主轴的方向(项目的排列方向)。
            row(默认值):主轴为水平方向,起点在左端。
            row-reverse:主轴为水平方向,起点在右端。
            column:主轴为垂直方向,起点在上沿。
            column-reverse:主轴为垂直方向,起点在下沿。
        flex-wrap   默认情况下,项目都排在一条线上。flex-wrap属性定义,如果一条轴线排不下,如何换行。
            nowrap(默认):不换行。
            wrap:换行,第一行在上方。
            wrap-reverse:换行,第一行在下方。
        flex-flow   flex-flow属性是flex-direction属性和flex-wrap属性的简写形式,默认值为row nowrap。
        justify-content     定义了项目在主轴上的对齐方式。假设主轴为从左到右。
            flex-start(默认值):左对齐
            flex-end:右对齐
            center: 居中
            space-between:两端对齐,项目之间的间隔都相等。
            space-around:每个项目两侧的间隔相等。所以,项目之间的间隔比项目与边框的间隔大一倍。
        align-items     定义项目在交叉轴上如何对齐。假设交叉轴从上到下。
            flex-start:交叉轴的起点对齐。
            flex-end:交叉轴的终点对齐。
            center:交叉轴的中点对齐。
            baseline: 项目的第一行文字的基线对齐。
            stretch(默认值):如果项目未设置高度或设为auto,将占满整个容器的高度。
        align-content   义了多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用。
            flex-start:与交叉轴的起点对齐。
            flex-end:与交叉轴的终点对齐。
            center:与交叉轴的中点对齐。
            space-between:与交叉轴两端对齐,轴线之间的间隔平均分布。
            space-around:每根轴线两侧的间隔都相等。所以,轴线之间的间隔比轴线与边框的间隔大一倍。
            stretch(默认值):轴线占满整个交叉轴。
    项目的属性:以下6个属性设置在项目上。
        order           定义项目的排列顺序。数值越小,排列越靠前,默认为0。
        flex-grow       定义项目的放大比例,默认为0,即如果存在剩余空间,也不放大。如果所有项目的flex-grow属性都为1,则它们将等分剩余空间(如果有的话)。如果一个项目的flex-grow属性为2,其他项目都为1,则前者占据的剩余空间将比其他项多一倍。
        flex-shrink     定义了项目的缩小比例,默认为1,即如果空间不足,该项目将缩小。
        flex-basis      定义了在分配多余空间之前,项目占据的主轴空间。浏览器根据这个属性,计算主轴是否有多余空间。它的默认值为auto,即项目的本来大小。可以设为跟width或height属性一样的值(比如350px),则项目将占据固定空间。
        flex        flex属性是flex-grow, flex-shrink 和 flex-basis的简写,默认值为0 1 auto。后两个属性可选。该属性有两个快捷值:auto (1 1 auto) 和 none (0 0 auto)。建议优先使用这个属性,而不是单独写三个分离的属性
        align-self      align-self属性允许单个项目有与其他项目不一样的对齐方式,可覆盖align-items属性。默认值为auto,表示继承父元素的align-items属性,如果没有父元素,则等同于stretch。该属性可能取6个值,除了auto,其他都与align-items属性完全一致。
TopGrid v3.01 for Delphi 7 installation notes This version of the TopGrid is intended for use with Delphi 7. The following files are installed: Directory Contents =================================================== [Installdir]\Lib The TopGrid component files [Installdir]\Help The help files [Installdir]\Examples The example program files [Installdir]\Source The source code files [Installdir] is the installation directory chosen during setup. 1. AUTOMATIC INSTALLATION On first installation, the installation program will automatically install the TopGrid components on the Delphi Component Palette if you choose to do so. The following package, which registers the TopGrid components in Delphi, will be installed: OSGDCLD73.BPL Installs the TopGrid components OSGDRP73.BPL Installs the TosGridReport component The components will be installed on a seperate tab in the Component palette labeled 'TopGrid'. If a version of the TopGrid is already installed, it will not be replaced by the new version on the Delphi Component Palette. Either remove the previous version from the Delphi Component Palette before installing the new version, or replace the old version manually. See below for manual installation instructions. 2. MANUAL INSTALLATION If you do not select automatic installation of the components, or if a version of the TopGrid is already installed on the Delphi Component Palette, the TopGrid components will need to be installed manually in the Delphi IDE before they can be used. To install TopGrid components, install the following package from the [Installdir]\Lib directory using the Component|Install Packages menu selection on the Delphi menu: OSGDCLD73.BPL Installs the TopGrid components OSGDRP73.BPL Installs the TosGridReport component If you already have an older version of the TopGrid installed, first remove the old packages from Delphi before installing the new ones. Also make sure the library path no longer points to the old location. It is recomme
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值