2016-03-21 10 views
-1

Ich habe drei divs in einem div, einer von ihnen ist rechts, ein anderer von ihnen ist auf der linken Seite und ich möchte dritte in der Mitte setzen, aber konnte es nicht tun;div Zentrum von div während dort noch zwei divs

<div id="durum3" style="width: 100%; height: calc(100% - 40px);"> 
 
    <div class="processes" style="width: 100%; height: 40%; max-height: 84px; border-bottom:2px solid #9d7db1; min-height: 64px; min-width: 240px;max-width: 360px"> 
 
    <div id="firmalar" style="height: 100%; background: red; width: 74px;float: left "></div> 
 

 
    <div id="islemler" style="height: 100%; background: yellow; width: 74px; text-align: center; float: left; margin: 0 auto;"></div> 
 
    <div id="pin" style="height: 100%; background: blue; width: 74px; float: right;margin-left: 5px "></div> 
 
    </div> 
 

 
</div>

Wie kann ich es beheben?

+0

Es sollte funktionieren, wenn Sie die 'float-Entferner: left' von islemler. Es ist eine gute Idee, wenn möglich alle Floats zu vermeiden, da sie die Elemente aus dem DOM entfernen. – gaynorvader

Antwort

3

Verwenden Flexbox und Sie brauchen nicht einmal height setzen:

<div style="background-color: #ccc; padding: 5px;"> 
 
    <div style="display: flex; height: 250px;"> 
 
    <div style="background-color: #99f; width: 25%"></div> 
 
    <div style="background-color: #9f9; width: 50%"></div> 
 
    <div style="background-color: #f99; width: 25%"></div> 
 
    </div> 
 
</div>

+1

Dislplay flex gelöst Problem dank –

Verwandte Themen