I always just use display: table on the containing element that does the trick.