在IE6、IE7、IE8、IE9下fieldset的padding值为0,firefox5、chrome13下左右内边距约为12px。
当把legend设为width:100%时,IE6、IE7出现水平滚动条,且legend与fieldset内其它内容没有对齐。解决方法为legend在IE6、IE7单独设置margin:0 -7px。
参考样式:
fieldset{border:0 none;background-color:red;padding:0;}
legend{width:100%;background-color:green;padding:0;*margin:0 -7px;}