I want to increase width of dropdown field in Django form, I tried both inline CSS as well as widgets, below is code I have tried
index.html
{% extends "base_generic.html" %}
{% block content %}
<form action = "" method = "post">
{% csrf_token %}
**<center>Product: <h6 style="width: 350px;">{{ form.product }}</h6></center>**
<br>
<center>Rules: {{ form.rule }}</center>
<input type="submit" value=Compute>
</form>
{% endblock %}
forms.py
from django import forms
PRODUCTS = (
('hp','HP'),
('wipro', 'WIPRO'),
)
class InputForm(forms.Form):
class Meta:
**widgets = {'product': forms.Select(attrs={'style': 'width:200px'})}**
product = forms.ChoiceField(choices=PRODUCTS)
rule = forms.CharField(widget= forms.Textarea, label="Rules")
How can I achieve this?