PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Targeting Custom Class

  1. hmarcks
    Member

    Hello,

    I'm having a hard time targeting a custom class. I set a class for "two-thirds-width" for a paragraph text field.

    The html output is:

    [html]
    <li id='field_1_25' class='gfield    two-thirds-width' ><label class='gfield_label' for='input_1_25'>Event Description</label><div class='ginput_container'><textarea name='input_25' id='input_1_25' class='textarea medium' tabindex='6'   rows='10' cols='50'></textarea></div></li><li id='field_1_5' class='gfield    two-thirds-width  gfield_html gfield_html_formatted gfield_no_follows_desc' ><div class="sectionblock-left">

    Can someone help me out with the css selector I need?

    Thank you

    Posted 7 years ago on Wednesday March 13, 2013 | Permalink
  2. hmarcks
    Member

    I've tried variations of "li#field_1_25 .gfield.two-thirds-width" with no luck. I'm trying to define the width of the whole element.

    Any help is appreciated, thanks -

    Posted 7 years ago on Thursday March 14, 2013 | Permalink
  3. Please share a link to the page on your site where we can see your form.

    Posted 7 years ago on Thursday March 14, 2013 | Permalink
  4. hmarcks
    Member

    *removed*

    Thanks Chris

    Posted 7 years ago on Thursday March 14, 2013 | Permalink
  5. Try adding this CSS to your theme's stylesheet:

    [css]
    body .gform_wrapper li.two-thirds-width textarea {
        width: 64%!important;
    }

    I used 64% since it lined up better with the three-across fields on the first line of the form. Adjust as you see fit.

    Posted 7 years ago on Thursday March 14, 2013 | Permalink
  6. hmarcks
    Member

    No luck. I tried variations, and adding a background and border to see if it was just the width that wasn't taking, but nothing.

    Edit - It works when I insert in the gravityforms css file, but not mine. I'm curious why this happens even with the custom class and !important. I've also been modifying other form css in my css file, odd.

    Thanks Chris

    Posted 7 years ago on Thursday March 14, 2013 | Permalink
  7. You should not modify the Gravity Forms forms.css file. If it works when you add it there, but not when you add it to one of your theme stylesheets, you are adding it incorrectly, or it's not a specific enough rule to override the others. If you add that back to your theme's stylesheet and post a link here, we will take a look and tell you why it's not working. We can't support modifications to the included Gravity Forms forms.css file, so you'll need to remove those to show us what is going on.

    Posted 7 years ago on Sunday March 17, 2013 | Permalink