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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to apply borders to the submit button?

Status
Not open for further replies.
Oct 11, 2006
300
US
Hi,

I would like to apply the same feature of a regular submit button to my submit button. I just formatted the color and the font. How to make it look like a submit button? Now it looks like a small rectangular box with that background and text in it. It does not look like a submit button.

My css code is:

Code:
.btn
{
color:#5a5b5e;
font-family: Verdana, Arial, Helvetica, Sans-Serif;
font-weight:bold;
background-color:#C7D9E6;
}

My html code is:

Code:
<input type="submit" value="Request Reports" class="btn">
 
Code:
<style type="text/css">
<!--
.button {
	border: 1px solid #000000;
}
-->
</style>

<input class="button" type="submit" value="Request Reports" class="btn">

M. Brooks
 
Oops.. I didn't notice that you actuall defined the input class. Use this one instead.
Code:
.btn {
	background-color: #C7D9E6;
	border: 1px solid #000000;
	color: #5a5b5e;
	font-family: Verdana, Arial, Helvetica, Sans-Serif;
	font-weight: bold;
}

M. Brooks
 
Thanks for the input. How to make it look 3 dimentional the way it looks for the normal submit button?

My button looks like a flat colored rectangle with borders.

Thanks.
 
Your button is already a submit button, just take away the class.
Code:
<input type="[red]submit[/red]" value="Request Reports" class="btn">

change to:

<input type="[red]submit[/red]" value="Request Reports">






----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
If I were to remove the class, I would not have a background color for the submit button.

Thanks.
 
You want a Windows style submit button that is slightly blue right?

The short answer is you can't when you apply a background to a submit button it looses the Windows look you want.

You would need to make an image and apply it as a background to the button. Otherwise you'll get the rectangular box.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
How to make it look 3 dimentional
Just give your borders different colours:
Code:
.btn {
    background-color: #999;
    border: 2px solid #666;
    border-top-color: #CCC;
    border-left-color: #CCC;
    color: #5a5b5e;
    font-family: Verdana, Arial, Helvetica, Sans-Serif;
    font-weight: bold;
}
On windows, the "light source" is considered to be at the top left, so the top and left borders should be lighter, and the right and bottom borders should be darker, than the face of the button. The result is a simple 3D effect.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top