Styling ClearableFileInput

I have the following in a template:

<div class="tag-fl">
    <label>{{ }}</label>
    {{ }}

Which expands into the following HTML:

<div class="tag-fl">
    <a href="/media/path/xxx/sample_child-1200x1200.png">
    <input type="checkbox" name="photo-clear" id="photo-clear_id">
    <label for="photo-clear_id">Clear</label><br>
    <input type="file" name="photo" accept="image/*" id="id_photo">

The visual rendition on the browser is not appealing. Therefore, I wish to style the elements manually. What is the best way to approach this?

  1. Hard-code the current output into the template. Which would require a parametric way of retrieving the href value (how do I do that?)

  2. Split the elements at template level using django-template-languge. I would prefer this but I do not know the ClearableInputFile class attributes or members. (e.g {{ }} gives me nothing). Is there a documentation for this?

Figured out how to write the href
<a href="/media/{{ }}">{{ }}</a>

Wishing there is a shorter way to reference the rest of the HTML e.g.:
{{ }}

but I guess that will be fruitless because then it would be hard to style the stray texts (e.g. Change:)

The template for that widget is located in django.forms.templates.django.forms.widgets.clearable_file_input. See Widgets | Django documentation | Django

You can override it so that every instance uses your version, or you could subclass the widget class referencing a different template if you only want to use your version in specific situations.