0

im currently new to django. I have search for many tutorial how to style django form without using any bootstrap. Can i style django form without bootstrap and using pure 100% css?. If it can be please show some example

I dont want use bootstrap with django form because it limited for me to style it. So i want to know the method to style django form with no bootstrap

  • You can find response to your question here: https://stackoverflow.com/questions/5827590/css-styling-in-django-forms – spandey Dec 10 '22 at 07:31

1 Answers1

0

you can write normal html css in an index.html file and use that like you use normally

<!DOCTYPE html>
<html>
<head>
<style> 
input {
  width: 100%;
}
</style>
</head>
<body>

<h2>A full-width input field</h2>

<form method="POST" action="/login">
  <label for="fname">First Name</label>
  <input type="text" id="fname" name="fname">
  <input type="submit" value="Submit">
</form>

</body>
</html> 

then it in your views.py , import required things and

def login(request):
    if request.method == 'POST':
        name=request.POST.get("fname")
        return HttpResponse("hey")
return HttpResponse("error")