Static FilesLesson 43Free preview
Add Styles to the Project
This lesson is part of Django · All levels
Summary
The project style is added via the CSS file referenced from the template. You create a CSS file in a static folder and then load it with the tag {% static %}. That way the entire page's view can be restored.
Key points
- Create a CSS file in the static folder
- Refer to {% static 'css/style.css' %}
- Apply to the parent template to spread
- Separate logic from appearance
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.