sei-ec-remote / team-project-issues

0 stars 0 forks source link

Cannot figure out how to access model fields for css styling #169

Closed DaceyForward closed 1 year ago

DaceyForward commented 1 year ago

Describe the bug A clear and concise description of what the bug is. Not a bug, but I want to change the font size of our add birthdays form, but I can't figure out how to access the fields from the model.

What is the problem you are trying to solve? I can't figure out how to access the fields from the model.

Expected behavior A clear and concise description of what you expected to happen. add birthday page

I want the fields on the right to change font size in css

What is the actual behavior? A clear and concise description of what actually happened. see above photo

Post any code you think might be relevant (one fenced block per file) birthday_form.html

{% extends 'base.html' %}

{% block content %}

{% if object %}
    <h1>Edit <span class="teal-text">{{object.name}}</span></h1>
  {% else %}
  <h1>Add A Birthday</h1>
   {% endif %}
  <!-- Leaving the action empty makes the form post to the same url used to display it -->
  <form action="" method="POST" class="card">
    <!-- Django requires the following for security purposes -->
    {% csrf_token %}
        <table class="responsive-table striped">
      <!-- Render the inputs inside of <tr>s & <td>s -->
          {{ form.as_table }}
        </table>
      <div class="row">
        <input type="submit" value="Submit!" class="waves-effect waves-light btn-large col s4 offset-s4 #ff80ab pink accent-1" id="add-submit">
      </div>
  </form>
  <br>
  <br>

  <script>
    const dateEl = document.getElementById('id_date');
    // M is Materialize's global variable
    M.Datepicker.init(dateEl, {
        format: 'mmmm d, yyyy',
        defaultDate: new Date(),
        setDefaultDate: true,
        autoClose: true
    });
  </script>

{% endblock %}

What is your best guess as to the source of the problem? I'm not accessing the fields correctly

What things have you already tried to solve the problem? I've tried adding classes and ids to different areas of the html (form and table tags)

Additional context Add any other context about the problem here.

Paste a link to your repository here https://github.com/DaceyForward/Pod1-Project-3.git

asands94 commented 1 year ago

You can check the class or id name by opening up your inspector and target that class/id name in your CSS and change the styling

DaceyForward commented 1 year ago

It doesn't have a class name and we tried to target the tag name of 'label' but it didn't work either. Is there a way to add a class or id? inspect

asands94 commented 1 year ago

Try targeting the label in the inspector and add styling to it and see if that works. if that does work you can do something like

.responsive-table label {
css styling here
}
DaceyForward commented 1 year ago

I've tried both ways and it still isn't working

DaceyForward commented 1 year ago

would i need to clear my cache again?

DaceyForward commented 1 year ago

That actually worked, clearing my cache 🙌

asands94 commented 1 year ago

The cache is always the issue! Glad it's working!