css with asp .net themes

Discussion in 'ASP .Net' started by Sems, May 24, 2010.

  1. Sems

    Sems Guest

    Hi

    I am using asp .net themes in my application and have a problem with
    the ordering of the css styles.

    I have a ie7 syle that must appear last in the masterpages head
    section however the css styles pulled in my the theme are inserted as
    the last part of the head section. This means that those styles over
    write the ie7 style sheet.

    Has anyone dealt with this before?

    Thanks
     
    Sems, May 24, 2010
    #1
    1. Advertising

  2. On May 24, 2:07 pm, Sems <> wrote:
    > Hi
    >
    > I am using asp .net themes in my application and have a problem with
    > the ordering of the css styles.
    >
    > I have a ie7 syle that must appear last in the masterpages head
    > section however the css styles pulled in my the theme are inserted as
    > the last part of the head section. This means that those styles over
    > write the ie7 style sheet.
    >
    > Has anyone dealt with this before?
    >
    > Thanks


    I think you cannot solve it using themes, and you can try to embed CSS
    condition in your master page

    <!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="/ie7.css" />
    <![endif]-->
     
    Alexey Smirnov, May 25, 2010
    #2
    1. Advertising

  3. Sems

    Sems Guest

    On 25 May, 09:25, Alexey Smirnov <> wrote:
    > On May 24, 2:07 pm, Sems <> wrote:
    >
    > > Hi

    >
    > > I am using asp .net themes in my application and have a problem with
    > > the ordering of the css styles.

    >
    > > I have a ie7 syle that must appear last in the masterpages head
    > > section however the css styles pulled in my the theme are inserted as
    > > the last part of the head section. This means that those styles over
    > > write the ie7 style sheet.

    >
    > > Has anyone dealt with this before?

    >
    > > Thanks

    >
    > I think you cannot solve it using themes, and you can try to embed CSS
    > condition in your master page
    >
    > <!--[if IE 7]>
    > <link rel="stylesheet" type="text/css" href="/ie7.css" />
    > <![endif]-->


    Hi,

    Thanks for your response.

    I am bringing in the IE7 style sheet like that, the issue is that when
    the theme pulls in its style sheets they appear in the head section
    after the IE7 sheet. This means that the IE7 styles are overridden.
     
    Sems, May 26, 2010
    #3
  4. On May 26, 10:16 am, Sems <> wrote:
    > On 25 May, 09:25, Alexey Smirnov <> wrote:
    >
    >
    >
    >
    >
    > > On May 24, 2:07 pm, Sems <> wrote:

    >
    > > > Hi

    >
    > > > I am using asp .net themes in my application and have a problem with
    > > > the ordering of the css styles.

    >
    > > > I have a ie7 syle that must appear last in the masterpages head
    > > > section however the css styles pulled in my the theme are inserted as
    > > > the last part of the head section. This means that those styles over
    > > > write the ie7 style sheet.

    >
    > > > Has anyone dealt with this before?

    >
    > > > Thanks

    >
    > > I think you cannot solve it using themes, and you can try to embed CSS
    > > condition in your master page

    >
    > > <!--[if IE 7]>
    > > <link rel="stylesheet" type="text/css" href="/ie7.css" />
    > > <![endif]-->

    >
    > Hi,
    >
    > Thanks for your response.
    >
    > I am bringing in the IE7 style sheet like that, the issue is that when
    > the theme pulls in its style sheets they appear in the head section
    > after the IE7 sheet. This means that the IE7 styles are overridden.


    ok, I see what you mean. You can solve it in the following way.
    Instead of writing the style in the master page, do it
    programmatically from the code behind. Put following lines in the
    Page_Load event of your master page

    Page.Header.Controls.Add(new LiteralControl(@"
    <!--[if IE 7]>
    <link rel=""stylesheet"" type=""text/css"" href=""/ie7.css"" />
    <![endif]-->"
    ));

    This should add your style after the theme's css like expected.

    Hope this helps
     
    Alexey Smirnov, May 26, 2010
    #4
  5. Sems

    Sems Guest

    On 26 May, 10:25, Alexey Smirnov <> wrote:
    > On May 26, 10:16 am, Sems <> wrote:
    >
    >
    >
    >
    >
    > > On 25 May, 09:25, Alexey Smirnov <> wrote:

    >
    > > > On May 24, 2:07 pm, Sems <> wrote:

    >
    > > > > Hi

    >
    > > > > I am using asp .net themes in my application and have a problem with
    > > > > the ordering of the css styles.

    >
    > > > > I have a ie7 syle that must appear last in the masterpages head
    > > > > section however the css styles pulled in my the theme are inserted as
    > > > > the last part of the head section. This means that those styles over
    > > > > write the ie7 style sheet.

    >
    > > > > Has anyone dealt with this before?

    >
    > > > > Thanks

    >
    > > > I think you cannot solve it using themes, and you can try to embed CSS
    > > > condition in your master page

    >
    > > > <!--[if IE 7]>
    > > > <link rel="stylesheet" type="text/css" href="/ie7.css" />
    > > > <![endif]-->

    >
    > > Hi,

    >
    > > Thanks for your response.

    >
    > > I am bringing in the IE7 style sheet like that, the issue is that when
    > > the theme pulls in its style sheets they appear in the head section
    > > after the IE7 sheet. This means that the IE7 styles are overridden.

    >
    > ok, I see what you mean. You can solve it in the following way.
    > Instead of writing the style in the master page, do it
    > programmatically from the code behind. Put following lines in the
    > Page_Load event of your master page
    >
    > Page.Header.Controls.Add(new LiteralControl(@"
    > <!--[if IE 7]>
    > <link rel=""stylesheet"" type=""text/css"" href=""/ie7.css"" />
    > <![endif]-->"
    > ));
    >
    > This should add your style after the theme's css like expected.
    >
    > Hope this helps- Hide quoted text -
    >
    > - Show quoted text -


    Great thats what I was looking for. Thanks
     
    Sems, May 27, 2010
    #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. Martin

    ASP.Net 2.0 themes vs css

    Martin, Jun 23, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,638
    Martin
    Jun 23, 2004
  2. Ryan Ternier
    Replies:
    1
    Views:
    744
    Scott Allen
    Dec 2, 2005
  3. Mike P

    asp.net 2.0 themes and css

    Mike P, Apr 4, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    824
    gerry
    Apr 10, 2006
  4. shapper
    Replies:
    1
    Views:
    462
    clintonG
    Nov 27, 2006
  5. randy.buchholz

    Re: CSS on controls overrides CSS on themes

    randy.buchholz, Aug 21, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    509
    randy.buchholz
    Aug 21, 2008
Loading...

Share This Page