2017-11-09 1 views
-2

Ich möchte ein wenig Spielraum zwischen Produkt div, aber der untere Rand funktioniert nicht. Ich habe auch position: absolute verwendet, aber nichts ändert sich. Bitte helfen Sie mir, weil ich mein Projekt mache.css margin-bottom funktioniert nicht

Output of current code

#mai-contant { 
 
    width: 100%; 
 
    max-width: 840px; 
 
    border: 1px solid; 
 
    float: right; 
 
} 
 

 
.product { 
 
    width: 100%; 
 
    max-width: 271px; 
 
    background-color: black; 
 
    border: 1px solid; 
 
    float: left; 
 
    margin-right: 12px; 
 
    overflow: hidden; 
 
    position: relative; 
 
    margin-bottom: 5px; 
 
}
<div id="mai-contant"> 
 
    <ul> 
 
    <li> 
 
     <div class="product"> 
 
     <img src="../images/004.jpg"> 
 
     </div>    
 
     <div class="product"> 
 
     <img src="../images/004.jpg"> 
 
     </div> 
 
     <div class="product"> 
 
     <img src="../images/004.jpg"> 
 
     </div> 
 
    </li> 
 
    <li> 
 
     <div class="product"> 
 
     <img src="../images/004.jpg"> 
 
     </div> 
 
     <div class="product"> 
 
     <img src="../images/004.jpg"> 
 
     </div> 
 
     <div class="product"> 
 
     <img src="../images/004.jpg"> 
 
     </div> 
 
    </li>  
 
    </ul> 
 
</div>

+0

Bitte geben Sie funktionierenden Code. –

+1

Es funktioniert perfekt. Überprüfen Sie es https://codepen.io/sirajalam049/pen/BmpzxB und versuchen Sie 'margin-bottom' zu ändern. – Siraj

+1

Das gleiche hier. Was scheint das Problem zu sein? "nicht funktioniert" ist keine gut genug Problembeschreibung, nicht einmal wenn Sie es 5 mal wiederholen. –

Antwort

1

Die Aufzählungspunkte brechen den Fluss. Entfernen Sie die Liste Styling:

#mai-contant > ul { 
    list-style: none; 
} 
0

Fügen Sie die folgenden CSS-Code-Zeile:

#mai-contant ul li:after { 
    content: ""; 
    display: table; 
    clear: both; 
} 
+0

Danke für Hilfe, aber es funktioniert nicht –