5.4 Best Practices & coding Style Flashcards

(10 cards)

1
Q

Why is consistent indentation important in HTML?

A

Improves readability, especially in large or team-based projects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What’s the recommended indentation style?

A

Use 2 or 4 spaces Consistently; avoid using tabs & spaces together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why should tag & attribute names be lowercase?

A

HTML is case-insensitive, but lowercase is the standard & most readable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is it necessory to quote attribute values?

A

Yes, values should be in double quotes for consistency & clarity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What’s wrong with <input></input>?

A

It’s missing quotes, should be <input></input>.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

why should you avoid unnecessary HTML elements?

A

Reduces file size, increases page speed, & simplifies maintenance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s a good example of minimizing unnecessary elements?

A

Don’t nest multiple <div>s when one is sufficient.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How should you organize your project files?

A

Use folders like /css, /js, /images, & keep index.html in the root.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What naming conventions should be used for files & folders?

A

Use lowercase letters & hyphens istead of spaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why should file names avoid spaces?

A

Spaces can cause issues in URLs & file handling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly