css with asp .net themes

S

Sems

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
 
G

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

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]-->
 
S

Sems

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?

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.
 
G

Guest

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
 
S

Sems

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]-->

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top