Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update html-questions.md #429

Merged
merged 2 commits into from
Jun 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions contents/html-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,16 @@ Yes, Pug (formerly Jade), ERB, Slim, Handlebars, Jinja, Liquid, and EJS just to

- https://neal.codes/blog/front-end-interview-questions-html/
- http://peterdoes.it/2015/12/03/a-personal-exercise-front-end-job-interview-questions-and-my-answers-all/

### What is the difference between canvas and svg?

Canvas is raster-based, working with pixels, while SVG is vector-based, employing mathematical descriptions of shapes. Canvas employs imperative drawing, where each step is specified with JavaScript, ideal for dynamic and interactive graphics like animations and games. Conversely, SVG uses declarative drawing, with shapes and paths defined directly in HTML, making it more accessible and SEO-friendly. Canvas is optimal for complex scenes due to its lower overhead, but scaling may lead to image quality loss. SVG, being resolution-independent, adapts to various screen sizes without sacrificing quality. Ultimately, canvas suits dynamic, performance-intensive graphics, while SVG excels in scalable, resolution-independent graphics, with inherent accessibility and SEO advantages


### What are empty elements in HTML ?

Empty elements in HTML are elements that do not contain any content between their opening and closing tags. Instead, they are self-closing tags, meaning they have a forward slash (/) before the closing angle bracket (>). Empty elements are used to insert objects, images, or line breaks into the HTML document. Some common examples of empty elements include:

<img>: Used to embed images into the document.
<br>: Used to insert line breaks or forced line breaks.
<hr>: Used to create horizontal rules or separators.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<img>: Used to embed images into the document.

<br>: Used to insert line breaks or forced line breaks.

<hr>: Used to create horizontal rules or separators.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<img>: Used to embed images into the document.
<br>: Used to insert line breaks or forced line breaks.
<hr>: Used to create horizontal rules or separators.
`<img>`: Used to embed images into the document.
`<br>`: Used to insert line breaks or forced line breaks.
`<hr>`: Used to create horizontal rules or separators.