这种样式,只能是自定义来实现,原始的html标签可没这样的哦,
常用的解决方法就是:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
name="viewport">
<meta content="ie=edge" http-equiv="X-UA-Compatible">
<title>Document</title>
<style>
.box {
width: 200px;
height: 200px;
border: 1px solid #ccc;
position: relative;
}
.box input {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
}
.box2 {
text-align: center;
line-height: 200px;
}
</style>
</head>
<body>
<div>
<div class="box">
<div class="box2">上传</div>
<input type="file" accept>
</div>
</div>
<script>
</script>
</body>
</html>
```
如果能帮到你,还望采纳
这个是需要自定义样式的。