make div fit height and width of content code example Example: css div width fit content display: inline-block;