1

I have tried this:

 .sign-out {
        height: 21px;
        width: 168px;
        color: #0854B3;
        font-family: Averta, serif;
        font-size: 14px;
        line-height: 21px;
        text-align: center;
        padding-top: 17px;
        margin-left: 291px;
    }

<html>
...
    <form method="post" action="{% url logout %}">
        {% csrf_token %}
        <div class="sign-out" type="submit">sign out</div>
    </form>
<html>

However the sign out text isn't clickable -- how do I make it so?

nz_21
  • 6,140
  • 7
  • 34
  • 80

1 Answers1

1

You basically made two errors here:

  1. in order to submit a form, the element to submit the form should be an <input> or <button> type, or you need to use some JavaScript to submit the form; and
  2. an {% url ... %} template tag expects as first parameter the name of the view, so a string.
<form method="post" action="{% url 'logout' %}">
    {% csrf_token %}
    <button class="sign-out" type="submit">sign out</button>
</form>

You can style the button as text with:

.sign-out {
    background:none!important;
    border:none; 
    padding:0!important;
    height: 21px;
    width: 168px;
    color: #0854B3;
    font-family: Averta, serif;
    font-size: 14px;
    line-height: 21px;
    text-align: center;
    padding-top: 17px;
    margin-left: 291px;
}
Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555