code not working in IE6 and IE8

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 2.0

I have this markup on my webpage. in the code I try to change the background
color of this div. but the background color isn't changed...
<div id="divQuery" runat="server" visible="false"
style="background-color:#0078ad; color:White; text-align:center;
font-size:12px; font-weight:bolder; font-family:Verdana; padding-bottom:5px;
padding-top:5px;">
<asp:Literal ID="litQuery" runat="server"></asp:Literal>
</div>

this is the code I use to change the background color:
if (Request.Path == "/test/games.aspx")
divQuery.Style["background-color"] = "#434087";

This code works in IE7, Opera and FiewFox but not in IE6, IE8

I've seen in the html output of the page that the div above has the
background-color #0078ad, which means that the color wasn't changed....

any suggestions?? could Request.Path be the problem??
 
Hi Jeff,

Jeff said:
hi

asp.net 2.0

I have this markup on my webpage. in the code I try to change the
background color of this div. but the background color isn't changed...
<div id="divQuery" runat="server" visible="false"
style="background-color:#0078ad; color:White; text-align:center;
font-size:12px; font-weight:bolder; font-family:Verdana;
padding-bottom:5px; padding-top:5px;">
<asp:Literal ID="litQuery" runat="server"></asp:Literal>
</div>

this is the code I use to change the background color:
if (Request.Path == "/test/games.aspx")
divQuery.Style["background-color"] = "#434087";

This code works in IE7, Opera and FiewFox but not in IE6, IE8
It could be that your Literal has already a Css class...

Oriane
 
what you mean with "It could be that your Literal has already a Css class"?

no css class is specified in the markup of the literal control....

This code works in IE7, Opera and Firefox, but somehow it doesn't work in
IE8 and IE6

any ideas?
 
Jeff said:
what you mean with "It could be that your Literal has already a Css
class"?

no css class is specified in the markup of the literal control....

This code works in IE7, Opera and Firefox, but somehow it doesn't work in
IE8 and IE6
If you give (by code or directly in the aspx file) a Css class to a control,
and then if you try to modify a parameter already set by the class (the
background color for instance), you will observe a different behavior in IE
6/7/8. In IE 6, the modification is taken into account, but this is not the
case in IE 8 where the CSS class parameters are not superseded.
any ideas?
No :-(
 
Back
Top