Membuat kolom kotak-kotak dengan css

/* HTML */

<div class="container">
<div class="element">1</div>
<div class="element">2</div>
<div class="element">3</div>
<div class="element">4</div>
</div>

/* CSS */

.container {
width: 300px;
}
.element ...

/* HTML */

<div class="container">
    <div class="element">1</div>
    <div class="element">2</div>
    <div class="element">3</div>
    <div class="element">4</div>
</div>

/* CSS */

.container {
    width: 300px;
}
.element {
    float: left;
    width: 64px;
    height: 64px;
    border: 1px solid black;
    text-align: center;
}
.element:nth-child(2n+1) {
    clear: left;
}

About Author

Gilang Sonar Amanu

Do It Do It Do It


Comment & Discussions

    Please LOGIN before if you want to give the comment.