how to make a div not change size code example Example: div not larger than its content The solution is to set your div to display: inline-block.