无法在网页上显示按钮

时间:2013-08-08 13:40:30

标签: html css button

这可能很容易,但一直在为什么它现在不起作用而感到头疼。

我有一个jpg图像我想用作按钮,我希望在其上显示一些文字。我试图在html和css(2.1)中这样做。

html是:

<a href="page2.aspx" class="dash_button">Some Text</a>

CSS是:

a.dash_button
{
   display:block;
   width:559px;
   height:55px;
   text-align:left;
   line-height:55px;
   background:transparent url("./images/dashboard_button.jpg") no-repeat;
   text-decoration:none;
   color:Blue;
}

从我读过的所有帖子中都应该有效。我正在使用VS2010并在IE10中进行测试

2 个答案:

答案 0 :(得分:1)

您必须检查图像路径并检查css样式

a.dash_button

{
display:block;
width:559px;
height:55px;
text-align:left;
line-height:55px;
background:url("../images/dashboard_button.jpg") no-repeat transparent;
text-decoration:none;
color:#3399cc;
}

答案 1 :(得分:0)

为什么不使用和输入按钮并使用CSS使其看起来如何?不是答案,只是一个建议。我认为这样做会更简单。