【问题标题】:ASP.Net Calendar Control styling background behind title标题后面的 ASP.Net 日历控件样式背景
【发布时间】:2016-01-29 14:11:07
【问题描述】:

我正在尝试删除日历标题后面的灰色背景,但没有任何运气。这是工具箱中的默认日历控件。谁能看到我错过了什么?

我的最佳猜测是:

#Calendar1 td
{
    background-color: transparent;
}

但是没有用。我似乎无法处理那种背景颜色。

【问题讨论】:

  • 就是上面显示的控件的渲染html。

标签: asp.net web-controls backcolor asp.net-webcontrol calendar-control


【解决方案1】:

您需要使用TitleStyle-BackColor="Transparent" 属性,如

<asp:Calendar ID="Calendar1" runat="server" TitleStyle-BackColor="Transparent">
</asp:Calendar>

【讨论】:

  • 成功了!我以为我可以使用 TitleStyle-CssClass 并在样式块中设置背景颜色,但这给了我上面的洋红色。谢谢
【解决方案2】:

来源:Calendar Class

尝试将 BorderWidth 属性设置为 0,将 BackColor 属性设置为透明。

ASP.NET 示例

      <asp:Calendar id="calendar1" runat="server">
           <BorderWidth = "0">
           </BorderWidth>

           <TitleStyle BackColor = "Transparent">
           </TitleStyle>
      </asp:Calendar>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-31
    • 2020-01-14
    • 2011-07-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多