Applying styles from multiple sources

Discussion in 'ASP .Net Building Controls' started by DalePres, Jun 26, 2004.

  1. DalePres

    DalePres Guest

    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, Jun 26, 2004
    #1
    1. Advertising

  2. DalePres

    Dale Guest

    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, Jun 29, 2004
    #2
    1. Advertising

  3. DalePres

    Iain Guest

    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, Jun 29, 2004
    #3
  4. DalePres

    Guest

    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
    >
    >
    >
    >
    , Jun 30, 2004
    #4
  5. DalePres

    DalePres Guest

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

    Thanks all for your advice on this one.

    Dale

    <> wrote in message news:...
    > 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, Jul 2, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sasquatch
    Replies:
    0
    Views:
    441
    sasquatch
    Nov 20, 2005
  2. sasquatch
    Replies:
    7
    Views:
    14,368
    Juan T. Llibre
    Nov 21, 2005
  3. =?Utf-8?B?TmVpbCBTdGV2ZW50b24=?=

    Applying CSS Styles to Dropdownlist

    =?Utf-8?B?TmVpbCBTdGV2ZW50b24=?=, May 15, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    60,963
    Juan T. Llibre
    May 15, 2006
  4. DalePres

    Applying styles from multiple sources

    DalePres, Jun 26, 2004, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    203
    DalePres
    Jul 2, 2004
  5. Peter Aitken

    Applying Styles

    Peter Aitken, Jul 22, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    238
    Peter Aitken
    Jul 22, 2004
Loading...

Share This Page