如何用CSS修改提交按钮样式

html-css018

如何用CSS修改提交按钮样式,第1张

非IE6浏览器,可以使用input:hover的伪类来控制样式,但IE6浏览器只能用JS来实现了,需要设定两个状态,然后用JS切换类。

<style>

#c_button { width:92pxheight:30px border:0float:left}

.c_up{background:url(../images/i_login_btn.png) no-repeat 0 top}

.c_down{background:url(../images/i_login_btn.png) no-repeat 0 bottom}

</style>

<input name="" id="c_button" class="c_up" type="submit" value="" title="点击登录"/>

<script type="text/javascript">

document.getElementById("c_button").onmouseover=function() {this.className = "c_down"}

document.getElementById("c_button").onmouseout=function(){this.className = "c_up"}

</script>

cssprofile提交后不可以新增学校。CSSProfile(简称Profile),是向个别私立大学提供奖助学金之基金会,申请奖助学金的表格,不可以用来申请任何政府奖助学金,亦非每间私立大学都需要。

当按钮的 type="submit"(提交)和 type="reset"(重置)时,可以加背景、修饰边框,做任何想要的样式,但如果效果是没有边框,也就是要border:none时,其它浏览器中显示正常,但在IE6中也是不起作用的,还是会存在黑色边框。

解决此问题很简单,我们只需要把type设置成button,这样就是可以做到兼容各个浏览器了。

示例:<input type="button" name="button" id="button" value="提交" />