Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.Net按钮赢得';不渲染背景图像_Asp.net_Css_Url_Background Image_Html Input - Fatal编程技术网

ASP.Net按钮赢得';不渲染背景图像

ASP.Net按钮赢得';不渲染背景图像,asp.net,css,url,background-image,html-input,Asp.net,Css,Url,Background Image,Html Input,我已经检查了关于这个主题的大部分链接问题,也检查了asp.net论坛中的链接问题,我被卡住了。我的一个.aspx页面中包含以下内容: <asp:button ID="btnAdmin" runat="server" Width="70px" Height="30px" Text="Admin" ToolTip="Facilities for administr

我已经检查了关于这个主题的大部分链接问题,也检查了asp.net论坛中的链接问题,我被卡住了。我的一个.aspx页面中包含以下内容:

<asp:button ID="btnAdmin" runat="server" Width="70px" Height="30px"
     Text="Admin" 
     ToolTip="Facilities for administrators" 
     CssClass="buttonStyleAdmin">
</asp:button>
我理解url语法应该与CSS文件的位置相关。在使用指向web的images目录的url进行了一些尝试之后,我放弃了并将上面的.png文件复制到web的根目录中;也就是说,它与.css文件本身相邻

我在Firefox中使用了Google开发者工具和Firebug,匹配的CSS规则似乎是正确的。也就是说,我可以将鼠标悬停在工具的部分上,URL解析为显示图像本身。

以下是呈现页面的Firebug视图:

如果我可以用网站根目录下的.png文件和.css文件来解决这个问题,那么我想更改对图像文件夹的引用,在该文件夹中收集所有其他图像,但是由于这两个文件都位于网站根目录下,所以我显然需要一些关于可能出现错误的建议。
我正在运行.Net Framework 3.5(Windows Server 2003)的Web服务器上使用Visual Studio 2008。

请尝试将

display: block;
background-position: 0px 0px;
进入.buttonStyleAdmin

我将您的代码/css放入一个空白项目,它与占位符图像配合得很好


否则,如果您有adblock,请尝试将其关闭。如果您尝试了上述内容,但没有说明您在其他案例/ASP论坛中已经尝试过的内容,请道歉。

以下是我提出的有效方法:

<asp:button id="btnAdmin" runat="server" 
    Text="Admin"
    ToolTip="Facilities for administrators"
    CssClass="coolbutton">
</asp:button>

谢谢你的主意。我试过了,但没有真正的改变(除了按钮本身的重新定位)。图像仍然没有渲染为控件的背景。我从未听说过adblock,但经过搜索,我想我没有它。如果是Chrome扩展,我没有。Firefox也是如此。简言之,我认为我没有adblock。谢谢你的关注。还有其他想法吗。从我给你们看的,我认为你们认为它应该工作,对吗?是的,据我所知,它应该工作,我把你们的确切代码放到VS中,它工作得很好。图片按钮对你有用吗?据我所知,我正在使用VisualStudio2008和CSS 2.0。你的VS是一样的吗?我在一个.NET3.5项目中使用了VS2010。你试过用其中一种来代替吗?
<asp:button id="btnAdmin" runat="server" 
    Text="Admin"
    ToolTip="Facilities for administrators"
    CssClass="coolbutton">
</asp:button>
.coolbutton
{
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
border-radius: 1em;
background-image: url(images/imgBlue-button-base.jpg);
background-position: center;
color: White; 
cursor:pointer;
}
.coolbutton:hover 
{
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
border-radius: 1em;
background-image: url(images/imgBlue-button-baseOn.jpg);
background-position: center;
color: Black; 
cursor:pointer;
}