HTML(4) 基础界面介绍

一、Box Model

1. Margin

Clears an area outside the border. The margin is transparent.

        1) Property: 

            margin-top, margin-right, margin-left, margin-bottom

        2) Syntax examples: 

  四值均为0

h1 { margin: 0; }

  20px: top and bottom, 10px: left and right.

h1 { margin: 20px 10px; }

  10px: top, 30px: right and left, 20px: bottom.

h1 { margin: 10px 30px 20px; } 

  top, right, bottom, left(上-右-下-左)

h1 { margin: 20px 30px 0 30px; }

2. Border 

A border that goes around the padding and content.

(顺序同margin)

3. Padding

Clears an area around the content. The padding is transparent.

(顺序同margin)

4. Content

The content of the box, where text and images appear.

二、float porperty

三、clear porperty

四、overflow porperty

          1. Value: 

           auto, hidden, and scroll.

五、dispaly porperty

          1. display: none

  The element will not be displayed.

main { margin-left: 100px; 
       padding: 10px;
       background-color: #FFFFFF; 
       display: none;}

          2. display: block

The element is rendered as a block element – even if it is actually an inline element, such as a hyperlink.

main { margin-left: 100px; 
       padding: 10px;
       background-color: #FFFFFF; 
       display: block;}

          3. display: inline

The element will be rendered as an inline element – even if it is actually a block element – such as a <li>.

main { margin-left: 100px; 
       padding: 10px;
       background-color: #FFFFFF; 
       display: inline;}

          4. display: inline-block

The element will display as an inline display element adjacent to other inline display elements but also can be configured with properties of block display elements including width and height.

main { margin-left: 100px; 
       padding: 10px;
       background-color: #FFFFFF; 
       display: inline-block;}

六、Position Property

        1. Static

                -Default value, the element is rendered in normal flow.

        2. Fixed

                -Configures the location of an element within the browser viewport; the element does not move when the page is scrolled.

        3. Relative

                -Configures the location of an element relative to where it would otherwise render in normal flow.

        4. Absolute

                -Configures the location of an element outside of normal flow precisely in its container element.

七、Pseudo-classes

          1. link(默认状态)

                - default state for a hyperlink.

          2. visited (访问过的链接)

  •         – a hyperlink that has been visited.   

          3. focus (用键盘选中时)

  •         – triggered when the hyperlink has focus.

          4. hover (鼠标移动到链接上时)

  •         – triggered when the mouse moves over the hyperlink.

          5. active (双击时)

  •          – triggered when the hyperlink is being clicked.

          6. 优先级 Priority

  1. :link(最低)< :visited < :focus < :hover < :active(最高)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值