Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stylesheets and custom tags in IE 1

Status
Not open for further replies.

NoCoolHandle

Programmer
Apr 10, 2003
2,321
US
I dont know that this is the correct forum, but if it isn't could you either A. Point me in the right direction or B. If you have the answer, could you please give it to me :)

In IE7/Netscape and Firefox..I can add a tag with a custom "class" attribute and then modify the components that use that class via a style sheet. In IE 6 the style sheet isn't picked up when the page is returned to the browser.. ANy help or advice appreciated..

I.E.
(in the asp/aspx)
Code:
response.write "<div class='_custClass'>Cool Red</div>"
and in the style sheet..
Code:
._custClass
{
  color:red;
}

Should give me

"[red]Cool Red[/red]" but in IE6 I get "Cool Red
 
Oh, and there are two things that you shouldn't be doing from the example you've given:

1) Using Response.Write to write any of your layout to the page
2) Using css classes that begin with an underscore


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Mark,

thanks re the _ bit.. that was the cause.

Re the response.write.. acutally I was adding the content to a labels.text property.. the result was nested <div>'s

It just goes to show. Don't follow blindly. The underscores came from some static html that I had to build around and I didn't change it.. That will teach me a lesson.

Again.. My thanks


Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top