Is the problem inside the element, around it, or between neighboring elements?
Then investigate:
text
padding
margin
border
gap
12. Why CSS does not work
Common causes:
Selector mismatch
HTML:
html
<button class="primary">
CSS:
css
.primary-button { ... }
These do not match.
CSS file not loaded
The code may be correct but the browser may not have received the file.
Rule overridden
Another rule may be more specific or loaded later.
Typo
css
font-szie: 20px;
The browser ignores the invalid property.
13. Developer tools
Right-click an element and choose Inspect.
Use:
Elements
Styles
Network
The Styles panel shows which rules apply and which are crossed out.
This is one of the most useful skills you can learn.
14. Exercise
Take a Django page and change:
heading size
paragraph color
button appearance
button padding
card border
card spacing
navigation layout
mobile spacing
Try before asking AI.
15. Using ChatGPT
Ask:
The cards on my Django page are too close together. Here is my HTML and CSS. Explain whether I should use margin, padding, or gap, and show the smallest change.
Remember
Recognize:
text
selector
class
property
value
margin
padding
border
flex
grid
gap
media query
Your goal is not to master CSS. Your goal is to make CSS feel understandable rather than mysterious.
Finished this lesson?
Completion is saved in this browser without creating an account.