sass - CSS Float issue within grid -


i aiming create simple image grid using css floats 'featured' blocks double size of others.

i have working fine when block featured i'm unable next block fit underneath correctly.

i've included jsfiddle make problem clearer. see @ bottom of output there block on row of it's own right of featured element (with class 'problem'). instead on left of featured block , on same row can add 2 blocks create completed grid can't work out how.

css:

.grid {     ul {         padding: 0;         margin: 0;         width: 100%;         li {             width: 20%;             float: left;             list-style: none;             box-sizing: border-box;             white-space: nowrap;             list-style: none;             line-height: 0;             img {                 width: 100%;             }         }     }     .featured {         width: 40%;     } } 

(nested css due scss).

full fiddle: link

any appreciated.

technically called dynamic grid layout

as per requirement have use jquery here because there no solid solution available using css , html.

there ready made plugins available online.

you can see or download demo here:

reference 1:

reference 2:


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -