This is a migrated thread and some comments may be shown as answers.

Customising HTML elements

1 Answer 62 Views
SkinManager
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 03 Sep 2010, 09:03 PM
Hello people from Telerik world!

This is my first steps with this amazing tool and I'm so impressed with its power, flexibility and documentation...
I've been learning ASP.NET and C# since 6 months ago...

I'm working in a draft based in 'http://demos.telerik.com/webmail/' for an Outlook-like application and the customer wants a combo to choose what skin he wants to see and for this, I was using this example.

I'm facing another problem: In this application, I have another HTML elements like headers (using divs), titles (using h1, divs and spans) that makes part of the visual identity of the application, but when I change the skin, for example, I would like that the header and titles, uses the same color from the current skin.

How can I do that?

I thought in create classes like .Header_Windows7, .Header_Black, .Header_Vista and so on in an external stylesheet used in the application, but how I should apply this for a div, for example?

Exists something like the following?

<div id="header" class="Header_<%= ??? %>">

Thanks,

Marcel

1 Answer, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 04 Sep 2010, 02:41 AM
Have you checked out the RadFormDecorator by any chance to style those elements automatically?  They should allow your overall theme to match...

Otherwise, what about this...Set the current skin value as a class on one of your main divs.  So then in your CSS you can say

.Vista h1{
 
}
 
.Outlook h1{
 
}

So just put a runat="server" on your wrapper so you can get at it in Page_Load

<div id="wrapper" runat="server">
    ...Controls go here...
</div>

So when the page renders it'll do something like this

<div id="wrapper" class="Vista">
    ...Controls go here...
</div>


Tags
SkinManager
Asked by
Marcel
Top achievements
Rank 1
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or