国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

【代碼筆記】Web-CSS-CSS Positioning

番茄西紅柿 / 2901人閱讀

摘要:因為圖像元素設置了屬性值為所以它會顯示在文字之后。參考資料菜鳥教程

一,效果圖。

 

 

 

二,代碼。

 

DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>CSS Positioningtitle>
    <style>
    p.pos_fixed {
        position: fixed;
        top: 30px;
        right: 5px;
    }
    
    h2.pos_left {
        position: relative;
        left: -20px;
    }
    
    h2.pos_right {
        position: relative;
        left: 20px;
    }
    
    h2.pos_top {
        position: relative;
        top: -50px;
    }
    
    h2.absolute {
        position: absolute;
        left: 100px;
        top: 150px;
    }
    
    img {
        position: absolute;
        left: 0px;
        top: 0px;
        z-index: -1;
    }
    style>
head>

<body>
    <p class="pos_fixed">Some more textp>
    <p><b>Note:b> IE7 and IE8 supports the fixed value only if a !DOCTYPE is specified.p>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some textp>
    <p>Some text

Some text

Some text

Some text

Some text

Some text

This is a heading with no position

This heading is moved left according to its normal position

This heading is moved right according to its normal position

Relative positioning moves an element RELATIVE to its original position.

The style "left:-20px" subtracts 20 pixels from the elements original left position.

The style "left:20px" adds 20 pixels to the elements original left position.

This is a heading with no position

This heading is moved upwards according to its normal position

Note: Even if the content of the relatively positioned element is moved, the reserved space for the element is still preserved in the normal flow.

This is a heading with an absolute position

With absolute positioning, an element can be placed anywhere on a page. The heading below is placed 100px from the left of the page and 150px from the top of the page.

This is a heading

因為圖像元素設置了 z-index 屬性值為 -1, 所以它會顯示在文字之后。

 

參考資料:《菜鳥教程》

文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。

轉載請注明本文地址:http://m.specialneedsforspecialkids.com/yun/1246.html

相關文章

  • 代碼筆記Web-CSS-CSS 教程

    一,效果圖。 二,代碼。 DOCTYPE html> CSS 教程 body { background-color: #d0e4fe; } h1 { color: range; text-align: center; } p { fon...

    endless_road 評論0 收藏0
  • 代碼筆記Web-CSS-CSS 語法

    一,效果圖。 二,代碼。 DOCTYPE html> CSS 語法 p { color: red; text-align: center; } Hello world! this paragraph is styled with css ? 參考資料:《菜鳥教程》

    zhangwang 評論0 收藏0
  • 代碼筆記Web-CSS-CSS id和Class選擇器

    一,效果圖。 二,代碼。 DOCTYPE html> CSS id和class選擇器 #para1 { text-align: center; color: red; } .center { text-align: center; } p.center...

    Pluser 評論0 收藏0
  • 代碼筆記Web-CSS-CSS background背景

    摘要:實例改文本插入在元素中該段落有自己的背景顏色背景圖片不重復,設置實例背景圖片只顯示一次,并與文本分開實例中還添加了屬性用于讓圖片與文本間隔開參考資料菜鳥教程一,效果圖。 二,代碼。 DOCTYPE html> CSS backgrounds h1 { background-color: #6495ed; } ...

    番茄西紅柿 評論0 收藏0
  • 代碼筆記Web-CSS-CSS Text(文本)

    摘要:文本加上上劃線全變成大寫文本的第一行縮進加上下劃線全變成小寫加上下劃線首字母大寫去掉鏈接的下劃線參考資料菜鳥教程一,效果圖。 ? 二,代碼。 ? ? DOCTYPE html> CSS Test(文本) body { color: red } h1 { color: #00ff00; ...

    tain335 評論0 收藏0

發表評論

0條評論

最新活動
閱讀需要支付1元查看
<