0

I'm using a block grid in Foundation:

<ul class="small-block-grid-3 medium-block-grid-6">
  <li>Something</li>
  <li>Something</li>
  <li>Something</li>
</ul>

I want each li to have the same height as it's width. Each li has a different width at each of Foundation's breakpoints.

I've checked the web and looked into vw, the only decent solution I can think of is setting the vw height to be the same as Foundations li width at each break point.

Is there a better solution?

I do not want to use anything other than CSS.

panthro
  • 22,779
  • 66
  • 183
  • 324
  • You may also check this answer for a grid of squares : http://stackoverflow.com/questions/20456694/responsive-square-columns/20457076#20457076 – web-tiki Nov 20 '14 at 11:50

1 Answers1

1

The alternative option in CSS to viewport units is to make use of padding-bottom

DEMO

div {
  width: 40%;
  padding-bottom: 40%;
  background: tomato;
}
<div></div>
Danield
  • 121,619
  • 37
  • 226
  • 255