Skip to content

Instantly share code, notes, and snippets.

@jsgao0
Created August 3, 2020 07:42
Show Gist options
  • Save jsgao0/79c42f31e51597381cf9aa66f2ec606b to your computer and use it in GitHub Desktop.
Save jsgao0/79c42f31e51597381cf9aa66f2ec606b to your computer and use it in GitHub Desktop.
custom styles for file upload button
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Custom Button of Upload File</title>
<style>
.upload-btn {
position: relative;
width: 40px;
height: 40px;
border-radius: 50%;
border: none;
background-color: #2b3344;
}
.upload-btn span {
color: #fff;
font-size: 25px;
font-weight: 100;
}
.upload-btn input[type=file] {
width: 40px;
height: 40px;
position: absolute;
left:0;
top: 0;
opacity: 0;
}
</style>
</head>
<body>
<div>
<button class="upload-btn">
<span>+</span>
<input type="file" />
</button>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment