0

Trying to make css for input type file but not working.In my code choose file button is coming above of button css So how to remove using css?

I want to show only blue color button with file upload process

Demo: https://stackblitz.com/edit/angular6-bootstrap4-navbar-8hr7um?file=src/app/app.component.html

<input #file type="file" id="fileInput" accept='image/*' (change)="preview(file.files)" class="btn btn-primary btn-block mx-auto" value="UPLOAD IMAGE" />

2 Answers 2

1

use below html(assuming you are using bootstrap)

<label class="btn btn-primary"> Browse <input type="file" style="display: none;"> </label>

Sign up to request clarification or add additional context in comments.

Comments

0

I think you are using Bootstrap's documentation for buttons, but what would work best for you is Bootstrap's documentation for input groups. Check out the second to last category on this page: https://getbootstrap.com/docs/4.5/components/input-group/. It's titled 'Custom file input.' I think if you put your style into these it would work.

2 Comments

Tried but I do not know How to use it.Can you update my stackblitz?
Hi again, sorry for the late response. I was not online over the weekend. Try pasting the code from jaibalaji's answer into your stackblitz. That should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.