关于file类型的input标签的使用技巧

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style>
			.file-btn {
				float: left;
				width: 100px;
				height: 50px;
				border: 2px solid blanchedalmond;
				background-color: antiquewhite;
				margin: 0;
				padding: 0;
				line-height: 50px;
				text-align: center;
				cursor: pointer;
				position: relative;
			}

			.file-btn input {
				width: 100%;
				height: 100%;
				position: absolute;
				left: 0;
				top: 0;
				opacity: 0;
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<div class="file-btn">上传文件
			<input type="file" />
		</div>
	</body>
</html>
posted @ 2024-12-12 20:05  觉远  阅读(35)  评论(0)    收藏  举报