【问题标题】:Masterpage in asp.net CSSasp.net CSS 中的母版页
【发布时间】:2018-04-02 02:37:21
【问题描述】:
My masterpage code:
<head runat="server">
<title>System</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<style>
.masterfixed { table-layout:fixed; color:rebeccapurple}
.masterfixed td { overflow: hidden;}
</style>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" >
<link href="bootstrap/css/masdesign.css" rel="stylesheet" type="text/css" >

我只想在我的母版页上显示我的颜色。但是为什么这适用于我的内容占位符中的所有字体。请帮忙谢谢。

【问题讨论】:

  • 在此处发布您的&lt;body&gt; 代码

标签: c# css master-pages


【解决方案1】:

您可以将contentplaceholder 放在一个 div 中,并为该 div 指定 CSS 类或您想要的样式:

<div style="font:bold 12px arial;color:#000000">
   <asp:ContentPlaceHolder ID="head" runat="server">
   </asp:ContentPlaceHolder>
</div>

如果不起作用,请在每个样式的末尾加上!important
sytle="color:#000000 !important"

这可以确保 div 使用这种样式,而不是 CSS 类中定义的样式。

【讨论】:

    猜你喜欢
    • 2011-02-12
    • 2015-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多