html入門-4

來源:互聯網
上載者:User

標籤:text   相互轉換   sof   容器   log   block   mic   jpg   com   

html入門-4

一.文本樣式:

  1.text-align:(水平對齊)

        left(居左)  center(置中)   right(居右)

 

 

 

  2.text-indent:(縮排)

    單位:em(字元)  px(像素)

 

 

  3.line-height:(行高)

 

  

   4.cursor:(游標)

      pointer(手型指標)       wait(等待)

      help (協助)            text(文本游標)

二.邊框樣式:( border)

  1.top (上)  bottom(下) left(左) right(右)

     2.width (線寬)

       3.style:solid(實線)  dashed (點滑線)   dotted(點線)

    4.color (顏色)

 

  注意:合成樣式中方位屬性(top,bottom等)直接跟在border後面 !

三.行元素與塊元素

  •  塊元素:

    1.獨佔一行

    2.設定寬高有用

 

 

  • 行元素:

    1.行元素是緊挨著上一個元素顯示,不會獨佔一行

    2.設定寬高沒有用

 

 

  • 行&塊元素 可以相互轉換

    display:  block  轉成塊元素

 

    display: inline   轉成行元素

    display: inline-block   轉成行塊元素,變成行元素,但是具有塊元素的特點(可以設定寬高)

 

四.精靈技術( css spirit )

  1.background-image

  2.background-color

  3.background-position(位置)

    left    center    right

    top    center    bottom

  4.background-repeat:(平鋪方式)

        no-repeat(不平鋪) repeat-x(水平平鋪) repeat-y(豎直平鋪)

  5.background-attachment:(固定)

  6.background合成樣式

    background : url(“./img/1.jpg”) no-repeat center top fixed;

 

 

  7.把容器的寬高 設定成 靶心圖表片 的大小(寬&高 )

  8.調節background-position座標值

 

五.盒模型

  1.padding:   盒子裡面的內容 距離 盒子四周的距離, 可以簡單的理解為"div"

    padding:20px;                      (內容到四周邊框的距離為20px)

    padding-top:10px;              (內容到上邊框的距離為10px)

    padding-right:20px;           (內容到右邊框的距離為20px)

    padding-bottom:30px;      (內容到下邊框的距離為30px)

    padding-left:40px;              (內容到左邊框的距離為40px)

    padding:10px 20px;             (內容到上、下邊框的距離均為10px,到左、右邊框的距離均為20px)

    padding:10px 20px 30px;  (內容到上邊框的距離為10px,到左、右邊框的距離均為20px,到下邊框的距離為30px)

 

 

 

  2.margin:  盒子&盒子之間的距離

     方位屬性與padding一樣,不設(top等)方位屬性時預設為四邊

 

 

 

 

html入門-4

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.