给Button添加背景图片
采用CSS的方式:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css" >
.btn
{
background-image: url('images/Nature.jpg');
background-repeat: no-repeat;
}
</style>
<title>Untitled Page</title>

</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="点击确认" CssClass="btn" />
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css" >
.btn
{
background-image: url('images/Nature.jpg');
background-repeat: no-repeat;
}
</style>
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="点击确认" CssClass="btn" />
</form>
</body>
</html>本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
This posting is provided "AS IS" with no warranties, and confers no rights.
This posting is provided "AS IS" with no warranties, and confers no rights.


浙公网安备 33010602011771号