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

資訊專欄INFORMATION COLUMN

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

番茄西紅柿 / 2893人閱讀

摘要:因?yàn)閳D像元素設(shè)置了屬性值為所以它會(huì)顯示在文字之后。參考資料菜鳥教程

一,效果圖。

 

 

 

二,代碼。

 

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

因?yàn)閳D像元素設(shè)置了 z-index 屬性值為 -1, 所以它會(huì)顯示在文字之后。

 

參考資料:《菜鳥教程》

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/1246.html

相關(guān)文章

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

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

    endless_road 評(píng)論0 收藏0
  • 代碼筆記Web-CSS-CSS 語(yǔ)法

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

    zhangwang 評(píng)論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 評(píng)論0 收藏0
  • 代碼筆記Web-CSS-CSS background背景

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

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

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

    tain335 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<