S.M_Emamian
S.M_Emamian

Reputation: 17383

Anchor Tag inside a div Not working

I would like to have an anchor to a like inside my div.I set style="z-index: 1000;" to parent div. but it doesn't work :

<?php

    <!-- Image  -->     
    <div class="content" style="cursor: pointer;" >
      <div class="mask_wrap" style="z-index: 1000;"> 
        <a href="{{base_url()}}offers/{{$o->url}}"> // start my anchor 
        <div class="mask_cont" > 


          <!-- info BOTTOM -->

          <div class="item_more">
            <div style="margin:0 70px"><a href="{{base_url()}}offers/{{$o->url}}" class="hover_more"></a> @if($moment )
              <div class="cat5" style="cursor:unset">پیشنهاد از لحظه خرید</div>
              @endif
              <div class="mantaghe">{{$o->zone}}</div>
              <div class="buyi"> {{$o->current_users}} خرید </div>
            </div>
          </div>
        </div>
        </a>  //end my anchor

Upvotes: 1

Views: 2603

Answers (2)

Rohman HM
Rohman HM

Reputation: 2827

Add this to your style

.mask_wrap {
    position:relative;
}
.mask_wrap a:after{
    content:"";
    position:absolute;
    width:100%;
    height:100%;
    left:0;
    top:0;
}

Upvotes: 0

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

z-index need position and by default the position is set to static and for this the z-index wouldn't work. So, you may apply position relative or absolute or fixed:

<div class="mask_wrap" style="z-index: 1000;position: relative"> 

Upvotes: 4

Related Questions