MARCELO Posted April 4, 2018 Share Posted April 4, 2018 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 Link to comment Share on other sites More sharing options...
dsonesuk Posted April 4, 2018 Share Posted April 4, 2018 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 Link to comment Share on other sites More sharing options...
MARCELO Posted April 5, 2018 Author Share Posted April 5, 2018 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. Link to comment Share on other sites More sharing options...
dsonesuk Posted April 5, 2018 Share Posted April 5, 2018 https://www.w3schools.com/code/tryit.asp?filename=FQ3I7UDR5Y9Q Link to comment Share on other sites More sharing options...
MARCELO Posted April 5, 2018 Author Share Posted April 5, 2018 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 Link to comment Share on other sites More sharing options...
dsonesuk Posted April 6, 2018 Share Posted April 6, 2018 (edited) 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 April 6, 2018 by dsonesuk Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now