HTML Codes Flashcards
Basics HTML codes
- What does this HTML display? <p>Hello World</p>
- A paragraph displaying the text "Hello World".
- What does this HTML display? <h1>Title</h1>
- A large heading displaying "Title".
- What is the output of <b>Hello</b>?
- The word "Hello" displayed in bold text.
- What does <i>Hello</i> produce?
- The word "Hello" displayed in italic text.
- What does this HTML create? <br>
- A line break that moves content to the next line.
- What does this HTML display? <hr>
- A horizontal line separating content.
- What will this HTML produce? <ul><li>Apple</li><li>Mango</li></ul>
- A bullet list with two items: Apple and Mango.
- What will this HTML produce? <ol><li>One</li><li>Two</li></ol>
- A numbered list with two items: One and Two.
- What does this HTML display? <a href="https://example.com">Visit</a>
- A clickable hyperlink labeled "Visit".
- What does this HTML display? <img src="cat.jpg" alt="Cat">
- An image from cat.jpg; if not found the text "Cat" appears.
- What happens if the alt attribute is missing in <img>?
- The image may still display, but accessibility and fallback text are lost.
- What does this HTML create? <table><tr><td>A</td></tr></table>
- A table with one row and one cell containing "A".
- What does this HTML create? <table><tr><th>Name</th></tr></table>
- A table with one header cell labeled "Name".
- What does <input type="text"> create?
- A single-line text input field.
- What does <input type="password"> create?
- A password input field where typed characters are hidden.
- What does <input type="checkbox"> create?
- A checkbox that can be checked or unchecked.
- What does <input type="radio"> create?
- A radio button used for selecting one option from a group.
- What does <textarea rows="4" cols="20"></textarea> create?
- A multi-line text input area with specified size.
- What does <select><option>A</option><option>B</option></select> create?
- A dropdown list with options A and B.
- What happens when clicking <button>Submit</button>?
- A clickable button element labeled "Submit".
- What does this HTML display? <strong>Hello</strong>
- The word "Hello" displayed with strong importance (usually bold).
- What does <em>Hello</em> display?
- The word "Hello" emphasized (usually italic).
- What does <mark>Hello</mark> display?
- Highlighted text "Hello".
- What does <small>Hello</small> display?
- The word "Hello" in smaller text.
- What does <sup>2</sup> represent in HTML?
- Superscript text, often used for exponents like x².
- What does <sub>2</sub> represent?
- Subscript text, often used in chemical formulas like H₂O.
- What does this HTML display? <p>Line1<br>Line2</p>
- Two lines of text inside a paragraph: Line1 and Line2.
- What happens if two <p> tags are used consecutively?
- Two separate paragraphs with spacing between them.
- What does <header> represent in HTML5?
- The introductory section of a webpage or section.
- What does <footer> represent?
- The footer section containing copyright or contact info.
- What does <nav> represent?
- A section containing navigation links.
- What does <main> represent?
- The main content of the document.
- What does <section> represent?
- A thematic grouping of content within a page.
- What does <article> represent?
- Independent self-contained content like blog posts.
- What does <figure> represent?
- Self-contained content like images or diagrams with optional captions.
- What does <figcaption> represent?
- A caption describing content inside <figure>.
- What does <video controls> create?
- A video player with playback controls.
- What does <audio controls> create?
- An audio player with playback controls.
- What does <canvas> allow developers to do?
- Draw graphics dynamically using JavaScript.
- What is the purpose of the data-* attribute in HTML?
- It stores custom data for use by JavaScript.
- What happens if multiple elements share the same id attribute?
- It breaks HTML standards and may cause JavaScript or CSS issues.
- What happens if an HTML tag is not closed properly?
- The browser attempts to auto-correct but layout issues may occur.
- What is the output of <p><b>Hello</b> World</p>?
- The word "Hello" is bold followed by normal text "World".
- What happens if HTML elements are nested incorrectly?
- Browsers attempt to fix it automatically but results may vary.
- What is displayed by <p hidden>Hello</p>?
- Nothing; the element is hidden from display.
- What does the contenteditable attribute allow?
- It allows users to edit the content directly in the browser.
- What does the draggable attribute enable?
- Allows elements to be dragged in the browser interface.
- What does <progress value="70" max="100"></progress> show?
- A progress bar indicating 70% completion.
- What does <meter value="0.6"> represent?
- A measurement within a known range such as disk usage or score.
- Why is <!DOCTYPE html> placed at the top of HTML files?
- To instruct the browser to render the page in HTML5 standards mode.