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

[Solved] Cascading styles from css being ignored...

1 Answer 146 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kalpesh
Top achievements
Rank 1
Kalpesh asked on 12 May 2009, 04:56 PM
Hi,

We are declaring global values for setting Margin and padding to 0 in the css file

*

{

                margin: 0;

                padding: 0;

               

}


This value is being then overwritten for specific elements (e.x. P tags) further down in the css, which is recognized by all the browsers. However, this value is setting the margin's and Padding's to all elements in the Editor to 0 and ignoring the overwritten values defined in the CSS

Example is

p{
margin-bottom: 10px
}

Editor ignores this margin specifically definef for p and uses the global margin which is the first in the CSS file

Please let usknow if this is something that can be fixed

Thanks

Kalpesh

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 13 May 2009, 06:27 AM
Hello Kalpesh,

Using the * approach to reset styles can trigger unwanted and hard to handle results, as the * is a very heavy selector. On the other hand, a good practice on websites that use third party controls is to refrain from using global (element) selectors, but rather class selectors, because due to the inheritance of CSS, and the fact that virtually any CSS property can be applied to any HTML element, it is really hard for control vendors to try to prevent such cases of inheritance.

I suggest you to abandon the asterisk reset, and to use a more bullet-proof approach - the classic reset:

html, body, form,
ul, li, p
h1, h2, h3, h4, h5, h6
/* you may add other elements here */
{
    padding: 0;
    margin: 0;
    list-style: none;
}


Greetings,
Martin Ivanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Kalpesh
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or