2016-05-22 7 views
1

Ich versuche ein div über ein anderes div in bootstrap zu platzieren, ich habe keine css von bootstrap geändert, so dass der gesamte code unten ist bootstrap keine benutzerdefinierte css hinzugefügt.bootstrap 3 z-index ein div über ein anderes div setzen

<div class="col-lg-3 listing-panel side-bar-for-single-listing" style="margin-top: 10px;"> 

     <div class="col-lg-12" style="z-index: 999; background: red; height: 40%;"> </div> 

     <form class="col-lg-12" style=" "> 

      <legend>Contact</legend> 

      <div class="form-group"> 
       <label for="IDinputName">Name*</label> 
       <input type="text" class="form-control" id="IDinputName" placeholder="Name"> 
      </div> 

      <div class="form-group"> 
       <label for="IDinputMobile">Mobile*</label> 
       <input type="text" class="form-control" id="IDinputMobile" placeholder="Mobile" > 
      </div> 

      <div class="form-group"> 
       <label for="IDinputMessage">Message*</label> 
       <textarea id="IDinputMessage" class="form-control" style="height: 100px;"></textarea> 
      </div> 



      <button type="submit" id="IDcontactSubmitBtn" class="btn btn-primary">Send</button> 

     </form> 

    </div> 

hier ist das, was ich zur Zeit habe ich die rote Box 100% des Formelements abdecken wollen:

enter image description here

Antwort

1

Lass es uns versuchen! Ich hoffe, es kann helfen! :)

<div class="col-lg-12" style="background: red none repeat scroll 0% 0%; position: absolute; left: 0px; top: 0px; height: 100%; z-index: -1; right: 0px; margin: 0px auto;"> </div>

0

Sie haben Position div absolute machen, die z-index hat

<div class="col-lg-12" style="**position:absolute**;z-index: 999; background: red; height: 40%;"> </div>