Applying styles from multiple sources

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Applying styles from multiple sources

    Is there a way to determine the order or priority of applying styles in a
    custom web control? For example, I have a control with default style
    settings for many features, and exposed public properties to change those
    settings as well. It is easy enough to set the value of the public property
    to the default, then use the public property to render my control.

    Where it becomes more confusing is when applying style sheets. If a
    developer uses my control and applies a style sheet, I have no way of
    knowing which style parameters he has applied in the style sheet. Therefore
    I don't know which default styles to leave out of my rendering.

    So the bottom line is, I think, how to prioritize and apply styles from
    default styles, public property styles, and css class styles.

    Thanks,

    Dale


    DalePres Guest

  2. Similar Questions and Discussions

    1. Newbie: Creating / Applying Styles
      Possible newbie question: Why is that when I create a style, be it Paragraph or Character, I select the text I want and it creates the style -...
    2. Applying styles to an image
      Hi! I am having the same problem, only with contribute 3... Once an image is clicked on or inserted, the style-selecting dropdown disappears,...
    3. Applying CSS styles to images in C3
      When Contribute 3 first came out, one of its new functionalities was listed as the following: The ability to add styles to images . for example...
    4. applying styles to images?
      i have a style (.imgBorder) which puts a 1px border around all images using that class. problem is i cant see how to apply that style to an image...
    5. Applying CSS styles to form objects
      I am trying to apply a certain BORDER style to text boxes, I have tried all of the settings but still cannot get this look (please look at text box...
  3. #2

    Default 2nd try. Anyone with thoughts on merging styles from css and styles?

    Second try here... Microsoft, Where're those 48 hour responses advertised in
    my MSDN subscription?

    Is there a way to determine the order or priority of applying styles in a
    custom web control? For example, I have a control with default style
    settings for many features, and exposed public properties to change those
    settings as well. It is easy enough to set the value of the public property
    to the default, then use the public property to render my control.

    Where it becomes more confusing is when applying style sheets. If a
    developer uses my control and applies a style sheet, I have no way of
    knowing which style parameters he has applied in the style sheet. Therefore
    I don't know which default styles to leave out of my rendering.

    So the bottom line is, I think, how to prioritize and apply styles from
    default styles, public property styles, and css class styles.

    Thanks,

    Dale



    Dale Guest

  4. #3

    Default Re: 2nd try. Anyone with thoughts on merging styles from css and styles?

    > Is there a way to determine the order or priority of applying styles in a
    > custom web control? For example, I have a control with default style
    > settings for many features, and exposed public properties to change those
    > settings as well. It is easy enough to set the value of the public
    property
    > to the default, then use the public property to render my control.
    >
    (I'm not microsoft, and am asking questions too - so don't expect too
    much!).

    Dale - I rather think that what happens will happen exactly as if all the
    style elements had been included in the resulting html. In fact that may be
    exactly how it works. Of course the style parse may well ignore overriden
    elements, but it won't know which they are for elements in style sheets
    defined outside .net.

    So in short I wouldn't worry about it. Any specific style="" in an element
    should override higher elements.

    Accordingly you should look at the style prioritisation rules.

    There's a little bit on this in 'Dynamic HTML' by Danny GOodman and no doubt
    an incomprehensible standard at W3C somewhere.


    Iain


    Iain Guest

  5. #4

    Default Re: 2nd try. Anyone with thoughts on merging styles from css and styles?

    Styles trickle down.

    or
    think bottom-up.

    an embedded style overrides an inline style,
    which in turn overrides linked stylesheets.

    hope this helps

    Dale wrote:
    > Second try here... Microsoft, Where're those 48 hour responses advertised in
    > my MSDN subscription?
    >
    > Is there a way to determine the order or priority of applying styles in a
    > custom web control? For example, I have a control with default style
    > settings for many features, and exposed public properties to change those
    > settings as well. It is easy enough to set the value of the public property
    > to the default, then use the public property to render my control.
    >
    > Where it becomes more confusing is when applying style sheets. If a
    > developer uses my control and applies a style sheet, I have no way of
    > knowing which style parameters he has applied in the style sheet. Therefore
    > I don't know which default styles to leave out of my rendering.
    >
    > So the bottom line is, I think, how to prioritize and apply styles from
    > default styles, public property styles, and css class styles.
    >
    > Thanks,
    >
    > Dale
    >
    >
    >
    >
    q@q.com Guest

  6. #5

    Default Re: 2nd try. Anyone with thoughts on merging styles from css and styles?

    Thanks all for your advice on this one.

    Dale

    <q@q.com> wrote in message news:40E268A6.5020004@q.com...
    > Styles trickle down.
    >
    > or
    > think bottom-up.
    >
    > an embedded style overrides an inline style,
    > which in turn overrides linked stylesheets.
    >
    > hope this helps
    >
    > Dale wrote:
    >
    > > Second try here... Microsoft, Where're those 48 hour responses
    advertised in
    > > my MSDN subscription?
    > >
    > > Is there a way to determine the order or priority of applying styles in
    a
    > > custom web control? For example, I have a control with default style
    > > settings for many features, and exposed public properties to change
    those
    > > settings as well. It is easy enough to set the value of the public
    property
    > > to the default, then use the public property to render my control.
    > >
    > > Where it becomes more confusing is when applying style sheets. If a
    > > developer uses my control and applies a style sheet, I have no way of
    > > knowing which style parameters he has applied in the style sheet.
    Therefore
    > > I don't know which default styles to leave out of my rendering.
    > >
    > > So the bottom line is, I think, how to prioritize and apply styles from
    > > default styles, public property styles, and css class styles.
    > >
    > > Thanks,
    > >
    > > Dale
    > >
    > >
    > >
    > >
    >

    DalePres Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139