Struggling with relative and absolute positions

I am unable to put the second button “gender” above the second input box. Please guide me where I am going wrong and what could be the fix for mpre than one Input box.

Hi there codeispoetry,

does this help…

.text-input input[type="text"] + label:last-of-type {

1 Like

yes, what if there are 3, in case →

You should wrap each single input and label in the div with a class of text-input as that is the stacking context for each input

You can of course then style the div to be horizontal if required.


Hi there @PaulOB,
Make sense. Thank you so much.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.