Within this div lies a student registration form with various inputs such as textboxes, dropdowns, etc. However, not every form will include all elements - some may be missing two or three textboxes. How can I dynamically adjust the height of the form based on its content using CSS?