Jump to content

Css Attribut Selector And Doctype


etjensen

Recommended Posts

I have some problems displaying a HTML page correctly in IE8. I do not have acces to the HTML file, but I'm able to modify the appearance from the CSS file. I have some probles using attribute selector. Here's an example. I'm using an attribute selctor to change the background of a table cell:td[width=100] { background-color: #FF9100;}This works fine in Firefox 3.5 and Chrome, but not in IE8. I have identified this to be a problem with the DOCTYPE. It's defined as follow:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">If I change this to<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">then everything works fin. Remember - I do not have access to the HTML file directly. Is this a bug i IE8? Is there a workaround here?(I'm no expert within this field...)Best regards,ETJ

Link to comment
Share on other sites

why not make a class, because i think your syntax may be incorrect....td{ width: 100__; /*you never declared the unit of measurement for this though, i.e. %, px, em, etc*/ background-color: #FF9100;}

Link to comment
Share on other sites

I do not think you understand the problem here. I'm not able to change the HTML file. I'm only able to change the style definitions in the CSS file. The table cell in the HTML file has no class or id set. Thus I'm trying to use the attribute selector to change the appearance of a cell in a table, as the combination of attributes are unique. It works fine, but not in IE8 with the specified DOCTYPE set. Chrome, Safari, Firefox etc are all ok.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...