I am trying to style the input "file" on my web page, but I keep having some problems with the button of this input. The result that is showing is as below:
The result that I want to achieve is as the submit button below the Choose File button. The problem is that I cannot style the button as the "Choose File", and when I try to change the color of the input file, it changes the background and not the button itself. The code that I am using for the Choose File button is:
input[type=file] {
border-radius: 4px;
border-color: $blue;
background-color: $blue;
border-width: 1px;
width: 100%;
-webkit-file-upload-button: hidden;
height: $base-spacing*2;
white-space: nowrap;
display: inline-flex;
align-items: center;
align-content: center;
text-align: center;
cursor: pointer;
line-height: 1.6rem;
font-size: 1.1rem;
}
The code of the HTML is:
<div>
<label for="Image" class="col-md-4 col-form-label text-md-right">
{{ __('Upload Image') }}:
</label>
<br />
<input id="Image" type="file" class="form-control-image{{ $errors->has('Image') ? ' is-invalid' : '' }}"
name="image_reference">
@if ($errors->has('image_reference'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('image_reference') }}</strong>
</span>
@endif
</div>
Can anyone help me figure out how can I fix the styling of the button Choose File?
Thank you all.