373 posts plop
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been part of the Envato Community for over 5 years
  • Made it to the Authors' Hall of Fame
+8 more
kimonothemes says

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!

373 posts plop
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been part of the Envato Community for over 5 years
  • Made it to the Authors' Hall of Fame
+8 more
kimonothemes says

Nevermind… I got it: form p:nth-of-type(6) label

3497 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says

Just keep in mind that IE8 and less don’t support CSS3 Selectors, so that style will be ignored there.

http://caniuse.com/#search=nth

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

Just keep in mind that IE8 and less don’t support CSS3 Selectors, so that style will be ignored there.

http://caniuse.com/#search=nth

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]-->
3497 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says


Just keep in mind that IE8 and less don’t support CSS3 Selectors, so that style will be ignored there.

http://caniuse.com/#search=nth

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.

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

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.

Good point…I guess since the choices are “male” and “female”, there is no need for the label “sex”

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by