Adds a class to the shorter of two elements.