Border of asp:panel

20,949

Try the following:

<panel style="border: 1px solid #000; width: 500px; height:500px;" 
    id="pan" runat="server">

</div>

Heres' the jsFiddle of it: http://jsfiddle.net/C5jqS/

When you're done, lose the inline CSS ;-)

Share:
20,949
Jacek
Author by

Jacek

ASP.NET programmer

Updated on March 14, 2020

Comments

  • Jacek
    Jacek about 4 years

    What I make wrong in this snippet of code?? I would like to have border around two divs, but I see line (rectangle with no content). Have you any idea? This code is inside my WebControl.

    <asp:Panel ID="pan" runat="server" BorderStyle="solid" BorderWidth="1px" >
        <div style="width:18%; float:left;">
            <asp:Image id="img" runat="server" AlternateText="X" ImageUrl=""/>
        </div>
    
        <div style="width:78%; float:left;">
            <b><asp:Label ID="lblTitle" runat="server"></asp:Label></b>
            <br />
            <br />
            <asp:Label ID="lblDescription" runat="server"></asp:Label>
            <br />
            <asp:Button id="btnSet" runat="server" Text="Ustaw>"/>
            <br />
            <br />
            <asp:Label id="lblYouHaveCreditText" runat="server" Text="Masz kredytu na usługę"></asp:Label>
        </div>
    </asp:Panel>