-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (51 loc) · 1.23 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>输入框demo</title>
<style>
.content1 {
width: 500px;
border: solid 1px red;
}
.content2 {
width: 800px;
border: solid 1px red;
}
.auto-input {
min-width: 100px;
/* max-width: 500px; 获取父元素的高度 */
display: inline-block;
font-size: 13px;
line-height: 20px;
text-align: left;
outline: none;
border: solid 1px blue;
}
.auto-input:empty::before {
content: attr(placeholder);
color: #999;
}
.auto-input:focus::before {
content: none;
}
</style>
</head>
<body>
<h1>未禁用</h1>
<div class="content1">
<div class="auto-input" maxlength="11111111111111111" placeholder="可以输入的..."></div>
</div>
<h1>禁用</h1>
<div class="content2">
<div
class="auto-input"
value="初始值"
placeholder="这个是禁止输入的..."
disabled
></div>
</div>
</body>
<script type="text/javascript" src="./index.js"></script>
</html>