开发者

what's are the css for an input field that has no css?

开发者 https://www.devze.com 2023-01-10 03:49 出处:网络
If I have 2 input fields with no CSS, and then I add ONLY a background color to one, it changes the look of that field completely. It seems to change at minimum, the height, the border, the border-sty

If I have 2 input fields with no CSS, and then I add ONLY a background color to one, it changes the look of that field completely. It seems to change at minimum, the height, the border, the border-style and the border color.

I know I can change the CSS for all the input fields to make them match. But does anyone know what the CSS is for the default settings of an input text field? I like the way it looks and I have to match many that have no CSS.

example:

<style type="text/css">
#b {
  background-color: #FFF;
}

开发者_如何转开发</style>
</head>
<body>

<form>
<input id="a" type="text" />
<input id="b" type="text" />
</form>
</body>


This is entirely browser and OS dependent, every browser has a different default style for input elements and will react differently when applying extra styles. For consistent cross-browser input elements you need to style every aspect of the element (at the very least borders, background and padding).


Welcome to the css resets world.

I found that it is simply a must for a web site to hav some reset rules, in order to stop all those quirks and different default values of certain elements.

The one im using is this one.

0

精彩评论

暂无评论...
验证码 换一张
取 消