Tuesday 8 November 2011

How to give style to different components in the ASP

Question Received:
        How to give style to the components implicitly without
giving it explicitly in the CSS file.

Solution:
       It can be marked up in the header content as,
    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        .styleForComponent
        {
            position: absolute;
            right: 4px;
            width: 17px;
            height: 18px;
        }
    </style>
    </asp:Content>
    It can be used in the asp BodyContent as,
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="BodyContent">
    <table style="styleForComponent">
    </asp:Content>

No comments:

Post a Comment