pythonhtmlcssjinja2flask-wtforms

How to increase the size of the booleanfield in flask form?


I am making a flask form that contains multiple checkbox. I have this code in the form.py file.

var_name = BooleanField('', default=False)

And I have this in the html.

<p>{{ var_name }}</p>

The checkbox that I get on the browser is too small. I guess it is the default size. How do I increase the size of the checkbox? Thank you


Solution

  • What you can do is, using a hint taken from the WTForms docs here, is add a class to the field::

    var_name(class_ = "checkbox")
    

    Then style it with CSS:

    .checkbox {
        height: 25px;
        width: 25px;
    }