kuran Posted September 15, 2010 Share Posted September 15, 2010 Apologies for the weird title, I tried to be as descriptive as possible.I made a simple web form, and for layout purposes I decided to have a 2px border around the input forms. The problem is that I want to use an image as my button graphic, and it automatically places a border around this image! Even if I specify 'border: 0' in the bolded part of the code.Here is what goes in the html: <div id="form"><form action="contact.php" method="post"><div class="columnleftform">Name<br> <input type="text" name="yourname" /> <br><br>E-mail<br> <input type="text" name="email" /><br><br>Subject<br> <input type="text" name="subject" /><br /></p></div><div class="columnrightform">Message<br /><textarea name="comments" rows="12" cols="70"></textarea></p><p>[b]<input value="Submit" type="image" src="images/submitbutton.png" width="104" height="46" >[/b]</p></div> This is the CSS associated: input {background-color: #F4EFE8;border: 2px solid #E2DCD7;font-family: georgia;font-size: 18px;color: #555555;}textarea {background-color: #F4EFE8;border: 2px solid #E2DCD7;font-family: georgia;font-size: 18px;color: #555555;} How do I fix this?Thanks for any help! If you need more information, or a link to the website, I will upload the current version. Link to comment Share on other sites More sharing options...
trevelluk Posted September 15, 2010 Share Posted September 15, 2010 I'd suggest adding a class to the submit button and then removing the border from this class in the CSS.So change your button to something like: <input value="Submit" type="image" src="images/submitbutton.png" width="104" height="46" class="submit"> And then add to your CSS: input.submit:{border-width: 0;} Link to comment Share on other sites More sharing options...
dsonesuk Posted September 15, 2010 Share Posted September 15, 2010 just target all input image types withinput[type=image]{border:none;} Link to comment Share on other sites More sharing options...
thescientist Posted September 15, 2010 Share Posted September 15, 2010 and for good measure include a unit declaration, i.e. 0px Link to comment Share on other sites More sharing options...
kuran Posted September 15, 2010 Author Share Posted September 15, 2010 and for good measure include a unit declaration, i.e. 0px Thank you everyone, for some reason the first suggestion did not give me any results.Although this code, input[type=image]{border:none;}, works perfectly. Link to comment Share on other sites More sharing options...
jeffman Posted September 15, 2010 Share Posted September 15, 2010 submit may be a reserved word and not allowed be used as a class name. I'm guessing. Link to comment Share on other sites More sharing options...
kuran Posted September 15, 2010 Author Share Posted September 15, 2010 submit may be a reserved word and not allowed be used as a class name. I'm guessing.Every time I ask a question here, I learn so much. What an amazing community. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.