Monday, March 26, 2012

Panel border color

Hi,

In my application, I am using a panel I can able to set the header to the panel like this:

<asp:Panel id="xx" runat="">Enter Login</asp:Panel>

Now I want to apply some top border color and width and on that I need to display the text(Enter login) how to set the style for the top border.

Thanks in advance

Hi,

use the CssClass attribute in the panel control and set it to, for example, panelTopColor. In CSS you define that class as

.panelTopColor {
border-top:1px solid #f00;
}

If you're unfamiliar with CSS, please take a look at this excellent tutorial:http://www.w3schools.com/css/.

Grz, Kris.


Hi,

The style is not applying to my Panel.


Did you include the css in the panel declaration part?

<asp:PanelID="Panel1"CssClass="paneltop"runat="server"Height="50px"Width="125px">

</asp:Panel>

And you are supposed to include a href to the css class in the head section.

Then the style will be applied to the panel.


Hello,
you need to declare you panel and use the css class like this

<asp:Panel id="xx" runat="">Enter Login</asp:Panel>

 
 
Sorry for my poor english.

Hi,

Can you give me some example .


First create a new folder named css in your application.

Inside that create a cssclass named general.css and write the code for the style to be applied for the panel

#paneltop

{

border-top:1pxsolidblack;

}

In the head section of your page include this.

<linkhref="css/general.css"rel="stylesheet"type="text/css"/>

And now you can include the css class in your panel declaration.

<asp:PanelID="Panel1"CssClass="paneltop"runat="server"Height="50px"Width="125px">

</asp:Panel>

Hope this helps.

Regards,

Lavanya.


Hi,

It is working.

Why we need to create the hyperlink. This need to be done when we are applying styles to Panel only.

Thanks


It is just to link the css to your page. Once it is linked , you can use the css methods in your page.

Regards,

Lavanya.


Hi,

kalkumar:

Why we need to create the hyperlink. This need to be done when we are applying styles to Panel only.

You'll need it when you use an external stylesheet, which I prefer personally because in that case all css is in a single and easy to update place. You can also use the <style> tag in the head section or even a style attribute in a html tag.http://www.w3schools.com/css/css_howto.asp.

With CSS you can make very nice designs and change the total look and feel of your site by just editing an external css file and adding other images etc. If you want an example of what can be done with it take a look atwww.csszengarden.com. It's always the same html but each time a different style sheet (CSS) and images.

Grz, Kris.

0 comments:

Post a Comment