child div expanding out of parent div issue Demo Add the following style to the #mainContent #mainContent { overflow:hidden; } Live demo