Unsemantic columns height

試著忘記壹切 提交于 2019-12-25 03:19:19

问题


I use the framework "unsemantic". When I create a grid of 4 columns, if all elements of the grid haven't the same height, the grid breaks ( from the third block ) when I reduce the window.

See here http://cemf.fr/lpem/paul-meyer/

Anyone know how to fix this?

Html :

<article class="grid-50 tablet-grid-50 mobile-grid-100"> 
    /* MY CONTENT HERE */
</article>

回答1:


ya it is happening because of the height of your first column.

One way is to create grid-container for every row.

<div class="grid-container">
    <article class="grid-50 tablet-grid-50 mobile-grid-100"> 
        /* MY CONTENT HERE */
    </article>
    <article class="grid-50 tablet-grid-50 mobile-grid-100"> 
        /* MY CONTENT HERE */
    </article>
</div>
<div class="grid-container">
    <article class="grid-50 tablet-grid-50 mobile-grid-100"> 
        /* MY CONTENT HERE */
    </article>
    <article class="grid-50 tablet-grid-50 mobile-grid-100"> 
        /* MY CONTENT HERE */
    </article>
</div>

Other way is to use clear on your third column ..

Add a class like.

 .article-jury:nth-child(3n){
    clear:both; 
   }

and add in class for the third column

 <div class="grid-container">
    <article class="grid-50 tablet-grid-50 mobile-grid-100"> 
        /* MY CONTENT HERE */
    </article>
    <article class="grid-50 tablet-grid-50 mobile-grid-100"> 
        /* MY CONTENT HERE */
    </article>
    <article class="grid-50 tablet-grid-50 mobile-grid-100 clearColumns"> 
        /* MY CONTENT HERE */
    </article>
    <article class="grid-50 tablet-grid-50 mobile-grid-100"> 
        /* MY CONTENT HERE */
    </article>
</div>


来源:https://stackoverflow.com/questions/25934800/unsemantic-columns-height

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!