etjensen Posted September 15, 2009 Share Posted September 15, 2009 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 More sharing options...
thescientist Posted September 15, 2009 Share Posted September 15, 2009 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 More sharing options...
etjensen Posted September 15, 2009 Author Share Posted September 15, 2009 Remember - I need to identify a spesific cell in a web page. You suggestion would set width and color for all cells on the page. Link to comment Share on other sites More sharing options...
thescientist Posted September 15, 2009 Share Posted September 15, 2009 You may be right, so just change the class name then..specific_cell /*or whatever you want to call it*/{ ...} Link to comment Share on other sites More sharing options...
etjensen Posted September 15, 2009 Author Share Posted September 15, 2009 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 More sharing options...
thescientist Posted September 15, 2009 Share Posted September 15, 2009 ah, i forgot that you couldn't edit the HTML. well, that makes things a little more tricky... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.