Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8881631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:23:14+00:00 2026-06-14T20:23:14+00:00

I have a Django project that is a decent size. I have lots of

  • 0

I have a Django project that is a decent size. I have lots of models and, consequencly, lots of modelForms. With this project, I have upwards of 50-60 forms, each of which have anywhere from 5 to 30 fields (quick math: around 250-500 fields in total).

Now, I want to style all of these forms fields to have a coherent, non-standard, style across my project. I don’t want to leave the standard web style for input fields, drop-down menus, and buttons etc. I know that I can style a single field by using the attrs={'class':'my_class'}. However, that requires me assigning the class to each field of each form. Thus, massively tedious and a lot of repeating.

Given that I have upwards of 500 fields, how should I go about styling all of these fields? It’d be great to be able to change the styling in one spot and have it reflected everywhere.

I was thinking of using jQuery to find all <input> fields and add a CSS class as the page is loaded. However, I can’t help think that there should be an easier, Django-esque way to achieve this.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:23:15+00:00Added an answer on June 14, 2026 at 8:23 pm

    You don’t have to use classes in order to style stuff with css, and jQuery will also not be needed in this case.

    Assuming you have some global stylesheet somewhere, you can just do

    input[type="text"]{
        border: 1px solid #f0f;
    }
    

    This will style all the inputs of type text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a django project which is laid out like this... myproject apps media
I have custom exceptions in my django project that look like this: class CustomFooError(Exception):
I have a Django project that, on one page, has multiple forms (in different
I have a Django project that has two models: Group and Person. Groups can
I have Django project on Dreamhost server which has several views that returns Json
I have a django project with 2 apps like this: ## tags app, models.py
I have a Django project, that has a Address model. This is used in
I have an existing Django project that has several models using concrete inheritance of
I have a Django 1.4 project that makes use of django-registration which calls a
I have a django project that I have been working on as a solo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.