How can I display my element(`class=“line”`) over all other elements/div?

后端 未结 3 1355
孤城傲影
孤城傲影 2020-12-22 09:43

How can I display my element(class=\"line\") over all other elements/div?

相关标签:
3条回答
  • 2020-12-22 10:17

    we can give in following ways:

    we can add class="line" to position property and mention Z-index property (layer concept)

    .line
    {
        position:absolute;
        z-index:2
    }
    .otherclass
    {
        position:absolute;
        z-index:1;
    }
    

    we should specify both in Position property

    0 讨论(0)
  • 2020-12-22 10:22

    You need to set z-index property of the element. ie

    .line{
     position:absolute;
     z-index:100;
    top : 0;
    left: 0
    }
    
    0 讨论(0)
  • 2020-12-22 10:27

    Add z-index to the css styling.

    z-index:100;

    why do you want to avoid margin-top?

    0 讨论(0)
提交回复
热议问题