Lesson 17 of 55
HTMLInline vs External CSS
7 min
Course progress31%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 17 of 55
HTML7 min
Keep these ideas in mind as you work through the lesson.
| Method | Scope | Performance | Maintainability |
|---|---|---|---|
Inline (style='…') | Single element only | No extra HTTP request, but overrides all other styles | Hard to manage, discouraged |
Internal (<style>) | Page‑specific | CSS loaded with HTML, no extra request | Better than inline but still mixes concerns |
External (<link>) | Site‑wide or shared | Cached by browser, reduces HTML size | Clean separation of concerns, recommended |
element.style.width = '50%').<style> used only for critical CSS? ✅style= avoided except for runtime changes? ✅If any answer is “no”, reorganise your CSS now.
Tip: Use a CSS preprocessor (Sass, Less) or PostCSS to keep styles DRY and maintainable.