November 6, 201313 yr Hey guys, I am having a go at styling a form.... I honestly hate forms but going for it anyway. I am having issues styling the submit button by itself as it is taking on the generic input style. The layout goes as follows (I have stripped it down to the basic bits I am talking about):- <div id="two-column"> Main form elements here <div id="contact-button" class="fourcol last"><input type="submit" value="Send" class="wpcf7-form-control wpcf7-submit pink-button" /></div> </div> So when this loads it brings up the generic input styling of:- input {padding: 9px; border: solid 1px #E5E5E5; outline: 0; background: #FFFFFF url('bg_form.png') left top repeat-x; background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF)); background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px); box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; -webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 8px; margin-bottom:20px;} but it also brings up the custom style I added in:- input .pink-button {background-color:#d1d1d1; text-indent:0px; display:inline-block; color:#FFF !important; font-family:arial; font-size:15px !important; font-style:normal; height:30px; line-height:30px; width:110px; text-decoration:none; text-align:center; margin-top:20px;} input .pink-button:hover {background-color:#ed1e79; -webkit-transition-duration: 1s; -moz-transition-duration: 1s; -ms-transition-duration: 1s; -o-transition-duration: 1s; transition-duration: 1s; color:#FFF !important;} input .pink-button:active {position:relative; top:1px;} Is there a way to stop both styles from running and just have one? Thanks in advance :-)
November 6, 201313 yr Make sure the generic input style is either erased or commented-out, then just remove 'input' from your custom styling, like so: .pink-button {background-color:#d1d1d1; text-indent:0px; display:inline-block; color:#FFF !important; font-family:arial; font-size:15px !important; font-style:normal; height:30px; line-height:30px; width:110px; text-decoration:none; text-align:center; margin-top:20px;} .pink-button:hover {background-color:#ed1e79; -webkit-transition-duration: 1s; -moz-transition-duration: 1s; -ms-transition-duration: 1s; -o-transition-duration: 1s; transition-duration: 1s; color:#FFF !important;} .pink-button:active {position:relative; top:1px;} If you want all submit buttons on your site (if there are multiples) to share this custom styling, then just add 'pink-button' as the class to each one. Keeping 'input .pink-button' would mean that it would style all input buttons as well as adding in the custom styling for pink-button.
November 6, 201313 yr Author Hi Throzen, Thanks for your response. The problem is, I cannot remove the generic coding as this applies to the rest of the contact form if you get me?
November 6, 201313 yr Have you got a space between input and .pinkbutton? I'm not sure that works. Try input.pinkbutton without a space in the css and see if that works because it should override any similar styles in input but will still leave any that are in the input style unless you repeat them in input.pinkbutton with the styles that you want.
November 8, 201313 yr Author Hi Wickham, Thanks for your response. It didn't work either the button just went funky. I think I am just going to pull all the code out and start from fresh as I had two different form styles. I think starting again would probably be the best thing. Thanks guys
Create an account or sign in to comment