Skip to content

CSS code snippet – How to make div width auto adjust?

.center {
  display: inline-block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
See also  How to use image zoom effect in CSS?
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.