css selectors - CSS - How to select nth-child of form element? -
i trying re-design registration form of wp website. add exta fields. increase width of <form>
container , set <input>
field's flow left. want set flow of phone field (which third child of <form>
element) none i.e. float: none;
. try this: form:nth-child(3) {float: none;}
seen not working. selects form rather 3rd field of form. wrong?
here registration page of site. please help.
you need include descendant combinator (the space):
form :nth-child(3) { /* css */ }
without space, you're selecting form
-element if it's third-child of parent, space you're selecting third-child elements of form
. elements direct descendants:
form > :nth-child(3) { /* css */ }
reference:
Comments
Post a Comment