Globally style all html buttons without requiring a "class", "id" or "name",

The following styles are all input tags, which means that any type of input tag is styled.

input {
 color:#050;
 font: bold 84% 'trebuchet ms',helvetica,sans-serif;
 background-color:#ffffff;
 border:1px solid;
 border-color: #696 #363 #363 #696;

}

how to isolate it, so that all input buttons "types" are styled differently than text "types", without the need to add / use "id", "class" or "name".

It should be a cross-browser solution.

+3
source share
3 answers
input[type=text]{
  color:#FF9900;
}

input[type=password]{
  color:#FFFF00;
}

input[type=submit]{
  color:#FFFFFF;
}

, , , , . , . , , , () 100px 2px , submit , 3/4 ., .

+11

css2 , citricsquid pixeltocode...

IE7.. , , CSS pre-IE7

, javascript IE6..

miscrosoft: CSS Internet Explorer

+5

HTML

input[type=submit] { color: #050; }
+1

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


All Articles