<div class="file-wrapper">
<input type="file" id="upload" hidden>
<label for="upload" class="file-btn">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg>
<span>Choose File</span>
</label>
<span id="fileName">No file chosen</span>
</div>
Back to Snippets
Custom File Upload Button CSS
Replace the boring default file input with this stylish upload button. It uses a label trigger to open the file dialog, which allows you to fully customize the appearance with CSS while keeping it accessible.
269