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

[Solved] Preventing the controls from using my css

2 Answers 27 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 12 May 2011, 02:06 PM
I am using the DatePicker control and the calendar is displaying a border around the back/month/forward links at the top. After looking at what CSS is getting used it appears that the links are using the "background:inherit" from my CSS. If I switch that bit off, then the calendar renders as expected.

Is it possible to have the controls to ignore any CSS that is not set by the theme?

Thanks

Michael

2 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 19 May 2011, 01:29 PM
To follow up on my original message I've been running into a number of issues when it comes to my own CSS and the CSS used by the controls. The problems I'm having are when I style the INPUT tag, for example, the controls inherit certains parts of the style. This seems to happen alot across a few of the controls.

What would be a good practice to prevent the controls from conflicting with my CSS? Should I create classes for every element that I wish to style? Is it possible to re-use the telerik styles on things such as tables, inputs, etc?

Any help would be appriciated as this is causing no end of headaches and I'm having to spend a lot of time managing these styles.

Kind Regards

Michael
0
Accepted
Dimo
Telerik team
answered on 19 May 2011, 04:05 PM
Hello Michael,

If you are using CSS selectors that are too global, they will almost surely influence other elements on the page, that you don't expect to. There is no universal prevention method for this, as this is the way CSS works.

In your case you should either modify your selectors (and/or add additional CSS classes), so that your styles do not affect other elements, or you should override the overridden Telerik styles.

I recommend you to get familiar with the concept of CSS specificity, which will help you understand better the problem and resolve it:

CSS Specificity Things You Should Know About

Cascading Order (W3C CSS Standard)

CSS: What Happens When a Conflict Occurs

Pay special attention to this presentation:

http://www.slideshare.net/maxdesign/css-cascade-1658158?from=ss_embed

The issue that we are discussing here is explained in slides 49 and the following.

Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or