Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zurb Foundation: Prevent empty column collapsing to zero width

Using Foundation, I sometimes have an empty column in a row, and that column gets collapsed entirely, engendering a mismatch between column data and column headers. Is there a way that I can prevent this collapse, making even empty columns get full width? (Is there a way besides inserting non-breaking spaces or other text into the otherwise empty columns?)

<div class="row">
  <div class="small-1 columns">Bruce</div>
  <div class="small-1 columns"></div> <!-- this gets collapsed to 0 width! -->
  <div class="small-1 columns">Dickinson</div>
</div>
like image 714
JellicleCat Avatar asked May 09 '14 16:05

JellicleCat


2 Answers

Apply the following css:

.column, .columns{
  min-height: 1px;
}
like image 147
user2830432 Avatar answered Sep 23 '22 19:09

user2830432


You could add some pseudo content to the containing element to trigger rendering.

Markup:

<div class="row">
  <div class="column">
    <p class="middlename"></p>
  </div>
</div>

CSS:

.middlename:before {
  content: "\00a0";
  font-size: 0;
}
like image 44
hohertz Avatar answered Sep 23 '22 19:09

hohertz