CSS Tricks

Home / Coding Tricks / CSS Tricks

Vertically Center a ‘div’ inside a ‘div’

Just apply the following CSS to the inner <div>:

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

Scroll Bar

::-webkit-scrollbar {
  width: 12px;

::-webkit-scrollbar-track-piece {
  background: #eee;
::-webkit-scrollbar-thumb {
  background: #444;

One Comment

Leave a Reply to ahsan Cancel reply

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