responsive container centered

Solutions on MaxInterview for responsive container centered by the best coders in the world

showing results for - "responsive container centered"
Llewelyn
16 Mar 2020
1.container {
2  width: 400px;
3  height: 300px;
4  background-color: #ccc;
5  position: absolute;
6  /*it can be fixed too*/
7  left: 0;
8  right: 0;
9  top: 0;
10  bottom: 0;
11  margin: auto;
12  /*this to solve "the content will not be cut when the window is smaller than the content": */
13  max-width: 100%;
14  max-height: 100%;
15  overflow: auto;
16}