How to make a container center both horizontally and vertically?

Leave a Comment
There are multiple ways of doing this. 1. Using Positions : We can use position relative and absolute.  How?  Make the window or the wrapper container as relative and set width and height as 100%. Make the inner div(which we need to place in the center) position absolute and all values as 0. Suppose the inner div is having id as 'centered-div'. Then our css would be. #centered-div {    position: absolute;  ...
Read More
Next PostNewer Posts Previous PostOlder Posts Home