how to create divs rowwise in css


Tags: html,css

Problem :

I want to create rowise block ie


| | div2| |div1 |div3 | |_______|div4|

but when i try this that 'div2' goes below 'div1' i have tried display rowise also div_container which holds all div1,div2,div3,div4 but it doesn't work my html code

#div_container
{
  height:325 px;
  width:600px;
  border-style: solid;
}
#div1
{
  height:325px;
  width:400px;
  border-style: solid;
}
#div2
{
  height:108px;
  width:200px;
  border-style: solid;
}
#div3
{
  height:108px;
  width:200px;
  border-style: solid;
}#div4
{
  height:108px;
  width:200px;
  border-style: solid;
}
<div id="div_container">
  <div id="div1">
    </div>
  <div id="div2">
    </div>
  <div id="div3">
    </div>
  <div id="div4">
    </div>
</div>

please suggest me Thank you in advanced



Solution :

add attribute display: and assign value to it inline-flex it will work

#div_container
{
    display:inline-flex;
}


    CSS Howto..

    How to make my twitter bootstrap overlap all other elements?

    How to get a fixed DIV to stay on top of an absolute?

    How to use Pseudo-Elements : before & :after to create end caps

    How to make CSS menu bar activated only after my mouse cursor is at the menu.

    How can I mark it up? [closed]

    Paragraph Span Class and h3 Are The Same Hex Code, But Are Showing Up As Different Colors

    How to increase the gap between text and underlining on my navbar links

    How to create a triangle in CSS3 using border-radius

    HTML CSS, how to create a Side bar or column

    How to find number of style classes defined in a CSS file

    “How to Ask” box when typing a question in SO. How do get that scrolling effect? Pure CSS or JS?

    How to make equal space between boxes in one row via CSS

    How to reset css before repeating sequence

    How to hide the toolbar in Chrome for Android tablets for a 100% high website

    CSS How to make image size relative to parent?

    How to move last li to right most side CSS

    How to remove space after a colon in CSS with Sublime Text 3?

    Ask Toolbar preventing Bootstrap Modal to show

    How do I change image on hover of that the img is in - in jQuery?

    Ionic2 : How to set up css in single page

    How can you grab elements in dom and apply different css without id?

    How do I get rid of the white space at the top of my web page?

    How to add background image to only one page in Jade

    How to slide/grow a tile to position with 90x90px with CSS

    How do I create a fallback for the HTML5 search cancel button in webkit?

    How do I uncollapse a margin?

    How to perform media queries if either statements are correct?

    How to re-render a page from a Google Chrome extension?

    How to make footer elements (image and label) centered?

    How to create mirrored image effect with CSS single element