5.4 Best Practices & coding Style Flashcards
(10 cards)
Why is consistent indentation important in HTML?
Improves readability, especially in large or team-based projects.
What’s the recommended indentation style?
Use 2 or 4 spaces Consistently; avoid using tabs & spaces together.
Why should tag & attribute names be lowercase?
HTML is case-insensitive, but lowercase is the standard & most readable.
Is it necessory to quote attribute values?
Yes, values should be in double quotes for consistency & clarity.
What’s wrong with <input></input>?
It’s missing quotes, should be <input></input>.
why should you avoid unnecessary HTML elements?
Reduces file size, increases page speed, & simplifies maintenance.
What’s a good example of minimizing unnecessary elements?
Don’t nest multiple <div>s when one is sufficient.
How should you organize your project files?
Use folders like /css, /js, /images, & keep index.html in the root.
What naming conventions should be used for files & folders?
Use lowercase letters & hyphens istead of spaces.
Why should file names avoid spaces?
Spaces can cause issues in URLs & file handling.