forked from itchief/ui-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput-text.html
84 lines (73 loc) · 2.14 KB
/
input-text.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Styling input</title>
<style>
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
h2 {
font-size: 1rem;
font-weight: 500;
}
input[type="text"] {
display: block;
width: 100%;
height: calc(2rem + 2px);
margin: 0 0 1rem 0;
padding: 0.25rem 0.75rem;
font-family: inherit;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #bdbdbd;
border-radius: 0.25rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
input[type="text"]::placeholder {
color: #212529;
opacity: 0.4;
}
input[type="text"]:focus {
color: #212529;
background-color: #fff;
border-color: #bdbdbd;
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(158, 158, 158, 0.25);
}
input[type="text"]:disabled,
input[type="text"][readonly] {
background-color: #f5f5f5;
opacity: 1;
}
</style>
</head>
<body>
<div style="max-width: 400px; margin-left: auto; margin-right: auto; padding-top: 10px; padding-bottom: 10px;">
<h2>Стилизованный input[type="text"]</h2>
<input type="text" placeholder="name">
<h2>в состоянии disabled</h2>
<input type="text" placeholder="name" value="Alexander" disabled>
<h2>в состоянии readonly</h2>
<input type="text" placeholder="name" value="Alexander" readonly>
</div>
</body>
</html>