<!-- Use preprocessors via the lang attribute! e.g. <template lang="pug"> -->
<template>
  <div id="app">
    <div class="container mx-auto">
      <div
        class="w-1/3 m-2 box inline-flex justify-center items-center text-2xl bg-green-200 text-blue-900"
        style="--aspect-ratio: 4/3"
      >
        4:3
      </div>

      <div
        class="w-1/3 m-2 box inline-flex justify-center items-center text-2xl bg-green-200 text-blue-900"
        style="--aspect-ratio: 2/3"
      >
        2:3
      </div>
      <div
        class="w-1/3 m-2 box inline-flex justify-center items-center text-2xl bg-green-200 text-blue-900"
        style="--aspect-ratio: 1/1"
      >
        1:1
      </div>
      <div
        class="w-1/3 m-2 box inline-flex justify-center items-center text-2xl bg-green-200 text-blue-900"
        style="--aspect-ratio: 16/9"
      >
        16:9
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      message: "Welcome to Vue!"
    };
  },
  methods: {
    doSomething() {
      alert("Hello!");
    }
  }
};
</script>

<!-- Use preprocessors via the lang attribute! e.g. <style lang="scss"> -->
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

.container {
  max-width: 800px;
}

.box {
  aspect-ratio: var(--aspect-ratio);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

button {
  background: none;
  border: solid 1px;
  border-radius: 2em;
  font: inherit;
  padding: 0.75em 2em;
}
</style>

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.0.3/tailwind.min.css

External JavaScript

This Pen doesn't use any external JavaScript resources.