tags:

views:

786

answers:

3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;
<html>
<head>
<style type="text/css">
form input[type=submit]{
background-color:#FE9900;
font-weight:bold;
font-family:Arial,Helvetica,sans-serif;
border:1px solid #000066;
}
</style>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<FORM action=""><INPUT type=text name=s> <INPUT type=submit value=Search> 
        </FORM>
</body>
</html>

the above code is not working in IE6 i cant put class or id in it. is there any css hacks for that ? This code is in word press i cant modify code i can only modify css

+3  A: 

You're right, it doesn't work.

Quirksmode.org is an excellent site with browser compatibility info:

http://www.quirksmode.org/css/contents.html

erikkallen
+2  A: 

Instead, give the input a class, and then style it from there. Like this:

<input type="submit" class="myClass" value="Search" />

And then style the .myClass in your CSS. This should also work in IE6.

Kim Andersen
Why was this downvoted? It's the solution
erikkallen
Yeah I don't get it either. How should I know that you couldn't insert some extra code?
Kim Andersen
+1  A: 

The Internet Explorer 6 doesn’t support the attribute selector [attr="value"]. So there is no way to address that submit input element with CSS only (IE 6 doesn’t support the adjacence selector + and :last-of-type selector neither that would help in this case).

So the only options you have is to either make that element uniquely addressable by adding a class or ID or wrapping it into an additional span element.

Or – as you’ve already stated that you can’t do that – use JavaScript to select that element and apply the CSS rule to it. jQuery can make this fairly easy:

$("form input[type=submit]").css({
    "background-color": "#FE9900",
    "font-weight": "bold",
    "font-family": "Arial,Helvetica,sans-serif",
    "border": "1px solid #000066"
});
Gumbo