djangoでページindex.htmlを表示したときcssが呼べない
アプリの構造は
polls/ static/ polls/ style.css template/ polls/ index.html
style.cssは
li a { color: green; }
index.htmlは
{% load static %} <link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}"> {% if latest_question_list %} <ul> {% for question in latest_question_list %} <li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li> {% endfor %} </ul> {% else %} <p>No polls are available.</p> {% endif %}
表示されたページのブラウザ上のソースは
<link rel="stylesheet" type="text/css" href="/static/polls/style.css"> <ul> <li><a href="/polls/2/">What's up?</a></li> <li><a href="/polls/1/">What's new?</a></li> </ul>
表示結果で、cssで指定した color: greenが反映されません。どこに問題が
あるのでしょうか
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。