Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

custom button in external .css

Status
Not open for further replies.

tomaustin

Programmer
May 24, 2004
30
0
0
GB

.submit {
border:none;
background-image:url(images/submit.jpg);
background-position:center;
background-repeat:no-repeat;
background-color:transparent;
}

if i put this in 2 style tags in the head of the page it works.

If I put it un my style sheet, it doesnt??

Also, wen I got it working, it still said submit wuery, do I put value="" to get rif of this

Thanks for all your help.
tom:)
 
<form name ="comment" method ="post" action ="javascript: alert('Thank you for your comment')">
<input type ="text" name ="comment" size="60">
<input class="submit" type="submit">

</form>
 

You haven't said how it doesn't work. Could it possibly be to do with paths? I see you have a path to an image (images/submit.jpg)... If your CSS file is in a different folder to your main file, you'd need to update that path.

Relative paths in CSS are relative to the CSS file, not the file that is including the CSS file.

Hope this helps,
Dan
 
technically, you could get away with:

<input type="submit" value="submit_value" />
image[type="submit"] { border: none }

but AFAIK, only Moz recognises the [attribute="attr_value"] syntax.

This is why tomaustin suggested adding the class="submit" attribute. However, as it works with an inline style, I suspect you have a class declaration in there anyway.


Any reason you're not using <input type="image" src="my_image.gif" alt="Submit the form" />?

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
thanks guys, I got it sorted

I was just having some file path trobles.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top