0

Normally, IE8 is the bane of my existence, but in this case it's the only browser that seems to be picking up the form background color correctly. Here is the CSS that seems to only be behaving as expected in IE8. Both Firefox and Safari have no background color to the forms.

#defaultform {

width: 500px;
padding: 20px;
background: #f0f0f0;
overflow:auto;

/* Border style */
border: 1px solid #cccccc;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;

/* Border Shadow */
-moz-box-shadow: 2px 2px 2px #cccccc;
-webkit-box-shadow: 2px 2px 2px #cccccc;
box-shadow: 2px 2px 2px #cccccc;

}
4

1 回答 1

0

可以是你的 doctype 吗?它适用于我在 Firefox 和 Safari 中使用这个:

<!DOCTYPE html>
<html>
<head>
<style>
#defaultform {

width: 500px;
padding: 20px;
background: #f0f0f0;
overflow:auto;

/* Border style */
border: 1px solid #cccccc;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;

/* Border Shadow */
-moz-box-shadow: 2px 2px 2px #cccccc;
-webkit-box-shadow: 2px 2px 2px #cccccc;
box-shadow: 2px 2px 2px #cccccc; 

}
</style>
</head>
<body>

<form id="defaultform" name="myform">
    <label>Input 1</label>
    <input type="text" name="input1" value="" />
</form>
</body>
</html>
于 2013-02-08T17:40:20.567 回答