Skip to content

How to fix element in the specific position

Daisho Komiyama edited this page Jun 14, 2018 · 3 revisions

Element width 240px

Use calc()

To have the element stay the same position regardless of screen width, use calc then subtract the element's width from the position (e.g. right: 40%) as shown below.

.tops-we-love .sections.is-03 .text-gp {
  bottom: -4%;
  right: calc(40% - 240px);
  /*transform: translate(-50%, -50%);*/
  width: 240px;
}
Clone this wiki locally