gpt4 book ai didi

asp.net - 不重复显示背景图像

转载 作者:太空宇宙 更新时间:2023-11-04 14:41:15 25 4
gpt4 key购买 nike

我试图在 ValidationSummary div 中放置一个小图标(在元素符号列表的左侧)。图像显示,但在我使用时重复:

background:url(Images/exclamation.png);

图像根本不显示,当我说:

background:url(Images/exclamation.png) no-repeat 12px 30px;

我在这里错过了什么。

CSS:

 .validationsummary
{
background:url(Images/exclamation.png) no-repeat 12px 30px;
border:1px solid #b08b38;
width:99%;
}
.validationsummary ul
{
color:#982b12;
background-color:PeachPuff;
}
.validationsummary ul li
{
padding:2px 0px 0px 15px;
font-size:12px;
}

ASPX:

<table width="100%">
<tr>
<td width="100%">
<asp:ValidationSummary ID="vs" runat="server" CssClass="validationsummary"
DisplayMode="BulletList" />
</td>
</tr>
</table>

<table width="100%" cellspacing="10px">
<tr>
<td width="11%" align="left">
* Surname
</td>
<td width="18%" align="left">
<asp:TextBox ID="txtSurname" runat="server" Width="93%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtSurname" SetFocusOnError="true" Text="*" ForeColor="Red"
Display="Dynamic" ErrorMessage="Surname Is Required"></asp:RequiredFieldValidator>
</td>
</tr>
</table>

最佳答案

尝试

.validationsummary
{
background:url(Images/exclamation.png) no-repeat 0 0;
border:1px solid #b08b38;
width:99%;
}

如果有效,请相应地放置您的背景。

关于asp.net - 不重复显示背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18311029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com