1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How does CSS adjust layers?

Discussion in 'HTML & Website Design' started by Gertrude, Sep 23, 2021.

  1. #1
    How to effectively adjust the up-down relationship of layers?
     
    Gertrude, Sep 23, 2021 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Can you give us an example?
    Are you using z-index?
     
    sarahk, Sep 23, 2021 IP
  3. Hafeez_CreativeHead

    Hafeez_CreativeHead Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    <html><head></head>
    
    <body><divstyle="background-color:red;
    width:300px;
    height:100px;
    position:relative;
    top:10px;
    left:80px;
    z-index:2"></div>
    
    <divstyle="background-color:yellow;
    width:300px;
    height:100px;
    position:relative;
    top:-60px;
    left:35px;
    z-index:1;"></div>
    
    <divstyle="background-color:green;
    width:300px;
    height:100px;
    position:relative;
    top:-220px;
    left:120px;
    z-index:3;"></div></body></html>
    Code (markup):
     
    Last edited by a moderator: Sep 28, 2021
    Hafeez_CreativeHead, Sep 25, 2021 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Layers is a paint program concept. HTML and CSS don't have "layers" so just what exactly are you even on about?
     
    deathshadow, Sep 27, 2021 IP
  5. Vivsmei

    Vivsmei Greenhorn

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #5
    The CSS layers refer to applying the z-index property to elements that overlap with each other. The z-index property is used along with the position property to create an effect of layers. You can specify which element should come on top and which element should come at bottom.
     
    Vivsmei, Sep 28, 2021 IP