/ Published in: CSS
                    
                                        
This snippet allows to vertically center the contents of a container without any extra markup by simply displaying it as a table cell. This allows you to use the vertical-align attribute.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
.container {
min-height: 10em;
display: table-cell;
vertical-align: middle;
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                