Displaying divs in rows

alin dradici

Is there a way to align the divs inside container 3 in a row?

<div class="container">
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>   
</div>
RizkiDPrast

Flexbox is come to solve that one. another (old) approach is to use display: inline-block (instead of float.)

.product {
  display: inline-block;
  width: 30%;
  height: 50px;
  border: 1px solid green;
}
<div class="container">
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>
      <div class="product"></div>   
</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Displaying 10 divs in rows

From Dev

CSS divs not displaying inline

From Dev

Icons displaying divs on hover

From Dev

Chrome not displaying divs

From Dev

Javascript-made Divs not displaying

From Dev

Displaying divs like tables with rowspans

From Dev

Images not displaying as background images on divs

From Dev

Displaying divs in a line within the header

From Dev

Displaying to divs in front of picture in div

From Dev

jQuery filter the displaying of divs issue

From Dev

Output not displaying all rows

From Dev

displaying the top 3 rows

From Dev

Change column divs to rows

From Dev

Bootstrap: stack rows of divs

From Dev

css margins not displaying divs in correct places

From Dev

Divs keep on displaying as block and not inline block

From Dev

CSS Float Issue - Divs displaying in improper location

From Dev

Displaying images in specific divs from for loop

From Dev

Divs with same id not displaying the same height

From Dev

Displaying multiple divs based on select tag selection

From Dev

Displaying alerts on different rows (vertically)

From Dev

Displaying rows according to Specific Values

From Dev

Displaying rows for last 7 days

From Dev

Displaying rows based on a 'category' field

From Dev

Displaying alerts on different rows (vertically)

From Dev

UITableView populated but not displaying data or rows

From Dev

Rows not displaying properly in Tkinter GUI

From Dev

Displaying divs as list items in a horizontally scrolling parent div

From Dev

inline-list filled with divs not displaying correctly with twitter bootstrap