html - CSS displaying elements vertically down instead of hortizontal straight -


i have elements wrapped inside div . elements displayed in horizontal direction inside div. problem , can't figure out how display elements vertically down direction. done research , 1 solution use vertical-align doesn't seem work.

here example of i"m trying accomplish

http://s9.postimg.org/6i34jzazz/save.jpg

my css

  .container {height:500px; width: 700px; background-color:#00b358} 

my html

  <html>   <head> <meta charset="utf-8" /> <link rel="stylesheet" href="css/navigation.css">   </head>    <div class="container ">   <img border="0" src="download.jpg" alt="pulpit rock" width="304" height="228">   <img border="0" src="1.jpg" alt="pulpit rock" width="304" height="228">   <img border="0" src="2.jpg" alt="pulpit rock" width="304" height="228">   </div> 

i don't think able achieve trying without re-organizing markup. have put divs in column containers (at least until flexbox used!).

quick example:

html:

<div class="container">     <div class="col-1">         <img border="0" src="download.jpg" alt="pulpit rock">         <img border="0" src="1.jpg" alt="pulpit rock">     </div>     <div class="col-2">         <img border="0" src="1.jpg" alt="pulpit rock">     </div> </div> 

css:

img {     display: block: }  .container > div {     float: left; } 

explaination:

the natural flow, if elements inline, appear beside 1 until line break needed. if elements block level appear below former element. other option float elements, again appear beside former element if there room, not below.

that's why have adjust markup group elements want in vertical line together--then float next group beside it.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -