Question : IE 7/8 CSS selector bug?

Hi guys. This is one I haven't encountered before: indeed, I've been using the attribute selectors for ages without problems. So what's different about this little test case when seen in IE8 (I have 7 compat mode turned on in the meta tags as you can see here, but it also fails ini IE8 native).

Do note that the moment I change the selector from input[type=text] to just plain input, the styling works as expected.

Funny thing is, IE dev tools shows the rule as being applied. Just no-show on the screen.

Has anyone encountered this before and what's the solution?

T
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">

  <title>Test Page</title>
  	<style type="text/css">
  		* { 
  			  margin:0; padding:0;
  			  font-size:11px;
  			  
		}  		
  		ul {
  			list-style:none;
  			margin:0;
  			padding:0;
  		}
  		
  		li {
  			display:list-item;
  			height:25px; line-height:25px;
  			border:1px solid red;
  		}
  		
  		label {
  			border:1px solid black;
  		}
  		
  		input[type=text] {
  			height:55px;
  			width:200px;
  			background:yellow;
  		}
  	</style>
  
  
  </head>
  <body>
  
  
  	<form>
	  	<ul>
	  		<li>
	  			<label>Test</label><input type="text" name="test" value="" />
	  		</li>
	  	</ul>
  	</form>

  </body>
</html>

Answer : IE 7/8 CSS selector bug?

The doctype in that document doesn't trigger standards mode, so IE is rendering the page in IE5.5 compatibility mode and so understands only a very limited set of CSS selectors.
Random Solutions  
 
programming4us programming4us