Call Us : +1-678-551-2452
+91 77381-86899

Align an element in center vertically & horizontally within a div element with Responsive layout

Below is the code to align any element in center or a div element, vertically and horizontally both in responsive layout.

Apply below CSS to the element that needs to be centered in a div:

position:fixed; top:50%; 
-webkit-transform:translateY(-50%); /* for chrome preview */ 
height: auto;
width: auto;
padding: 0; 
Leave a Reply

Pay with PayPal

Icon Web Solutions Service
Other Amount:


It has been a great pleasure working with Icon Web Solutions on the development of my digitized logo and website. From the initial phases of web design, the Icon Web Solutions team has been a pleasure to work with
Naren, USA