开发者

Forms and buttons

I would like to have some guidance on how to make good fo开发者_StackOverflow中文版rms with submit buttons that look flat but not like the default ones that are done when using html. I want the submit buttons like those found on this website.


You should try applying CSS to your submit buttons like follow:

<head>
.......
your html code
.....
<style>
.pass {
   width: 105px;
   padding: 5px;
   margin: 2px;
   font-weight: bold;
   color: #065fba;
   background: #f4f5f8;
   font-size: 11px;
   border: #e2e2e2 1px solid;
 }
</style>
</head>
.......
your html code
.....
<input trpe="submit" class="pass" value="Submit" />
......
...
.

Hope this helps.


The css use for the 'Post Your Answer' button on this website is (more or less):

input[type="submit"] {
    border: 1px solid #888888;
    font-family: Trebuchet MS,Liberation Sans,DejaVu Sans,sans-serif;
    font-size: 130%;
    font-weight: bold;
    margin: 3px;
    padding: 2px;

For cross-browser compatibility you'll need to add a class to your <input type="submit" /> as the CSS [type=""] attribute isn't recognised in older versions of Internet Explorer.


If you want to see how any element has been styled on any examples you like the look of, use Firebug or its equivalents for other browsers, which will show you the CSS applicable to a selected element.

In Stack Overflow's case, it's this, with the buttons being wrapped with a <div class="form-submit">:

.form-submit input {
    border: 1px solid #888888;
    font-family: Trebuchet MS,Liberation Sans,DejaVu Sans,sans-serif;
    font-size: 130%;
    font-weight: bold;
    margin: 3px;
    padding: 2px;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜