Jump to content
MARCELO

Multistep form selection

Recommended Posts

In the case below, i tried to add nth child selector so i could stablish different size for a answer box in this multiplestep form. It worked only for the first tab (last name), and i tried to do the same to the second tab like i show in the case below (contact info: email), but it seems it wont work. 

How can i select it?

 

https://www.w3schools.com/code/tryit.asp?filename=FPU3YSO7NHLC

Share this post


Link to post
Share on other sites

p:nth-child(2) {
    padding: 100px;
}

Should target the second child paragraph of the parent element div it is in.

p:nth-child(3) {
    padding: 100px;
}

Should target the third child paragraph element (if it exists, IE the birthday form) of the parent div element it is in.

That is what i am seeing

Share this post


Link to post
Share on other sites

Well, now it is working as you said. But i can t select any box i want. The email field, for example. How could i select it?

Besides, in this example below i changed the input padding using the n child selection, but i couldnt move the YYYY to the beggining of the box. Is it possible?

 

Thanks. 

Share this post


Link to post
Share on other sites

Sorry,  But i still can t select any box i want. The email field, as i told u as an example. How could i select it?

The n child seems to select only certain fields.. the first one in step one, the second in step two, the third in step 3.....

At least, that s what s happenning here

 

And thanks. 

I ll study what you answered me

Share this post


Link to post
Share on other sites

Well the easier way would be to use unique id for these paragraph or input, since you are finding it difficult to target these elements using nth-child()'

or use attribute selector

input[name='email']{background:red;} where it will target the' name="email" ' of the email input.

Edited by dsonesuk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×