Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Remove the default "size=40" attribute?

  • I need to set different widths for my input boxes for IE versus other browsers, the most accurate of which is supposedly to do the pixel width in CSS. Unfortunately, the “size=” attribute in the text form fields is added by default, whether I specify the size or not, and that appears to override my CSS…so any styles I use that are conditional on browsers won’t work.

    Is there a way to keep CF7 from automatically adding size=40 if I don’t want any size to be applied at all, and instead control that through stylesheets?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Same problem for me.

    Same for me – with one difference – How do I change the size of the forms as such? 🙂

    Just target your style with appropriate tag, it will work regards of default size…

    Thanks biswajeet, that was actually the first thing I tried…but it doesn’t work. The “size” attribute within the actual tag always overrides any CSS I put in the stylesheet. I just wish there was a way to keep Contact Form 7 from adding the “size” attribute at all, instead of always adding it regardless of whether it’s defined in the contact form.

    Here you go div.wpcf7 input { width: 25%; }
    Just put this line on your theme css or alternately you can modify CF7 css as per your choice.

    In case if your theme has any conflict, well in that case you need to investigate the issue…

    If this doesn’t work, then let me know the url of your form.

    Thank you, I will try that on Monday and see if it fixes the issue. I will still need to define two different ones, depending on if it’s IE or not. But hopefully this will at least fix this particular issue!

    I tried the technique above, but now it’s caused another issue. Any field for which I have defined the size is now overridden by this percentage, and appears at 80% of the maximum possible width, even if I’ve tried to set it to a smaller size.

    Using max-width instead of width offers closer results, but still not accurate. I am playing with it to see if I can get it how I need it, but any other suggestions would be very welcome.

    Its time consuming to provide resolution in this way…
    If you need accurate result, provide your form url and your style requirement details. Will write the necessary css for you.

    That would be very generous of you, thank you. Unfortunately our form is currently on a development server, not visible to the public. I will see if I can get a public version and send it to you, to see if you have any ideas.

    Thanks again!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Contact Form 7] Remove the default "size=40" attribute?’ is closed to new replies.