replacing center by div or p, depending if there is a block inside