Chrome default borders on text input

I am trying to understand the default boundaries that Chrome applies to elements. In this example, I use input text.

When using jquery to get the border I have

$("input").css("border")
"2px inset rgb(0, 0, 0)"

in the chrome dev tab. I see that this is correct because it is the same shown on the calculated chrome style tab.

Howerver, when I try to manually apply "2px inset rgb(0, 0, 0)"to the border of an element (via jquery cssor directly through the stylesheet), I get a completely different border. I can notice that rgb (0, 0, 0) is black, but the default border in chrome is really gray ...

I'm confused .. I have a fiddle that shows this http://jsfiddle.net/MicheleC/jE5K7/

EDIT:

This is the Chrome UI stylesheet.

border: 2px inset;
border-image-source: initial;
border-image-slice: initial;
border-image-width: initial;
border-image-outset: initial;
border-image-repeat: initial;

which lead to

enter image description here

1:   rgb (238, 238, 238)?

2: ? - $("input").css("border-bottom-color"), , , rgb (0, 0, 0)

3: border: 2px inset rgb(238, 238, 238); ( , ), - ?

enter image description here

+4
2

input . , , CSS. , , , "" , CSS , .

, CSS, CSS "" , -.

, <input>, CSS, getComputedStyle ( , jQuery , , CSS. , thats border: inset 2px, ( ). , , CSS. , . Chrome , 1px 1px.

, . border-color , CSS. , 2px , , .

, : , input . , .

:

  • rgb(238, 238, 238) Chrome dev, , , . , - . , , .
  • , , getComputedStyle, CSS- <input> - .
  • , , CSS.
+6

100%, , , "" css-. "none", / ( , ).

, !

-1

Source: https://habr.com/ru/post/1541934/


All Articles