A General Technology & Development Blog

Technology, Development, Programming – Magento, Wordpress.

Home » Css problem – how to vertical align

Css problem – how to vertical align

If you want to vertical align an element with CSS you can do so much easier than first thought.

Simply add this line of code to your CSS property:

.element {
position: relative;
top: 50%;
transform: translateY(-50%);

You can change .element to reference the item you want to vertically align.

  • Was this Helpful ?
  • Yes   No

Name of author

Name: BlogOwner

Short Bio: "The master has failed more times than the beginner has even tried."

eXTReMe Tracker