MENU

css (1)Intro (0)Markdown (0)Next.Js (1)

가로세로 비율유지 div

July 6, 2023
.parents {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
}

.child {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}