开发者

how to set the color for all the content pages in master page

开发者 https://www.devze.com 2022-12-10 12:34 出处:网络
i have 6 content placeholder in my master page. i needto set thebackground color [body] forall mycontent place holder in my master pagetolightgoldcolor.sothatall mycontent pagewilcontentthiscolor[bod

i have 6 content place holder in my master page. i need to set the background color [body] for all my content place holder in my master page to light gold color. so that all my content page wil content this color[bod开发者_StackOverflow中文版y]

how do do it


The best way would be css:

body {
    background: #FFD700;
}

As an alternative to Dave's solution, you could have a div at the top level inside your placeholders:

<asp:Content ID="first" ContentPlaceHolderID="_firstContainer" runat="server">
    <div class='content'>
        // do presentation
    </div>
</asp:Content>

With css:

.content{
    background: #FFD700;
}


You could wrap each content placeholder in a div in the master page then style each div so that the background colour is light gold.

<div class="goldcontent">
    <asp:ContentPlaceholder ID="Content1" runat="server"></asp:ContentPlaceholder>
</div>

<%-- other controls --%>

<div class="goldcontent">
    <asp:ContentPlaceholder ID="Content2" runat="server"></asp:ContentPlaceholder>
</div>

<%-- etc --%>

Then in your css file

div .goldcontent
{
    background-color: # FFD700;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消