- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Item was Featured
- Grew a moustache for the Envato Movember competition
- Beta Tester
- Spain
- Has been a member for 3-4 years
- Interviewed on the Envato Notes blog
Hi,
I’m stuck with something in CSS and I can’t figured out how to do it, it would be nice you can me out 
Here the HTML :
<form name="registerform" method="post" action="http://www.belote.com/v2/wp-login.php?action=register" id="registerform">
<p>
<label>Username:</label><label></label>
</p>
<input name="user_login" class="input" id="user_login" type="text" />
<p></p>
<p>
<label>E-mail:</label>
</p>
<input name="user_email" class="input" id="user_email" type="text" />
<p></p>
<p>
<label>Mot de passe</label><br />
<input name="mgm_register_field[14]" size="25" class="input mgm_register_field" value="" type="password" />
</p>
<p>
<label>Sexe</label><br />
<select name="mgm_register_field[15]" class="mgm_register_field">
<option value="Homme">Homme</option>
<option value="Femme">Femme</option>
</select>
</p>
<p>
<input id="wp-submit" value="Register »" type="submit" tabindex="100" />
<input name="redirect_to" value="http://www.belote.com/v2/inscription/" type="hidden" />
</p>
</form>
Do you have an idea how the heck I can select the label “Sexe” in CSS to put a display:none on it without editing the HTML to add a class (I can’t edit the HTML ).
Is this possible?
Thanks for your help!
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Item was Featured
- Grew a moustache for the Envato Movember competition
- Beta Tester
- Spain
- Has been a member for 3-4 years
- Interviewed on the Envato Notes blog
Nevermind… I got it: form p:nth-of-type(6) label
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
Just keep in mind that IE8 and less don’t support CSS3 Selectors, so that style will be ignored there.
sevenspark said
Just keep in mind that IE8 and less don’t support CSS3 Selectors, so that style will be ignored there.
In that case, he can use a conditional comment to include jQuery to achieve the same thing in those browsers:
<!--[if lt IE 9 ]>
<script>
$('form p:eq(6) label').css('display':'none');
</script>
<![endif]-->
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
fillerspace said
sevenspark said
Just keep in mind that IE8 and less don’t support CSS3 Selectors, so that style will be ignored there.In that case, he can use a conditional comment to include jQuery to achieve the same thing in those browsers:
<!--[if lt IE 9 ]> <script> $('form p:eq(6) label').css('display':'none'); </script> <![endif]-->
Yup
But if we’re talking about a javascript solution the element might as well just be removed from the DOM altogether I think. Not sure what the motivations are for removing the label in the first place.
sevenspark said
YupBut if we’re talking about a javascript solution the element might as well just be removed from the DOM altogether I think. Not sure what the motivations are for removing the label in the first place.
Good point…I guess since the choices are “male” and “female”, there is no need for the label “sex”
