<html>
<head>
<title>测试css修改</title>
</head>
<body>
<img src="1.png" />
<input type="button" >

function changeCss() {
//alert("hello");
$("#myButton").val("提交中……")
$("#myButton").css("width", "100px")

$("#myButton").css({ "background": "url(1.png) repeat-x", "overflow": "hidden" });
}


</script>
</body>

</html>

以上例子为,通过jQuery,修改按钮背景图片。

特别需要注意的是,repeat-x后面千万不能有分号;

相关文章:

  • 2021-07-10
  • 2021-12-23
  • 2021-10-31
  • 2021-09-26
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案