Basic 100 html short question and answer

 

HTML Basics (1–20)

  1. Q: What does HTML stand for?
    A: HyperText Markup Language

  2. Q: What is the latest version of HTML?
    A: HTML5

  3. Q: What tag is used to create a hyperlink in HTML?
    A: <a>

  4. Q: Which tag is used to insert an image?
    A: <img>

  5. Q: What does the <p> tag define?
    A: A paragraph

  6. Q: What is the root element of an HTML document?
    A: <html>

  7. Q: Which tag contains metadata for the HTML document?
    A: <head>

  8. Q: Which tag defines the title of the document?
    A: <title>

  9. Q: What is the correct tag to make text bold?
    A: <b> or <strong>

  10. Q: What is the correct tag to make text italic?
    A: <i> or <em>

  11. Q: What attribute is used to define inline styles?
    A: style

  12. Q: What attribute is used to define an image source?
    A: src

  13. Q: How do you write a comment in HTML?
    A: <!-- Comment -->

  14. Q: What tag is used to define a line break?
    A: <br>

  15. Q: What tag creates a horizontal line?
    A: <hr>

  16. Q: What tag is used for a list item?
    A: <li>

  17. Q: What are the two types of lists in HTML?
    A: Ordered (<ol>) and unordered (<ul>)

  18. Q: How do you create a numbered list?
    A: Using <ol>

  19. Q: What tag defines the body of the HTML document?
    A: <body>

  20. Q: Which tag creates a table?
    A: <table>


Attributes and Formatting (21–40)

  1. Q: What tag defines a table row?
    A: <tr>

  2. Q: What tag defines a table cell?
    A: <td>

  3. Q: What is the tag for a table header cell?
    A: <th>

  4. Q: How do you set the background color of an element?
    A: Using style="background-color:color"

  5. Q: What tag is used for headings?
    A: <h1> to <h6>

  6. Q: Which is the largest heading tag?
    A: <h1>

  7. Q: Which is the smallest heading tag?
    A: <h6>

  8. Q: How do you create a checkbox in HTML?
    A: <input type="checkbox">

  9. Q: How do you create a radio button?
    A: <input type="radio">

  10. Q: Which tag is used for input fields?
    A: <input>

  11. Q: How do you create a text area?
    A: <textarea>

  12. Q: What tag is used to create a form?
    A: <form>

  13. Q: How do you submit a form?
    A: Using <input type="submit">

  14. Q: What does the action attribute in <form> do?
    A: Specifies where to send the form data

  15. Q: What does the method attribute in <form> do?
    A: Defines how to send form data (GET or POST)

  16. Q: What is a self-closing tag?
    A: A tag that does not need a closing tag (e.g., <br>, <img>)

  17. Q: How do you open a link in a new tab?
    A: Add target="_blank" to <a>

  18. Q: What does the alt attribute in <img> do?
    A: Provides alternative text for the image

  19. Q: What tag defines a dropdown list?
    A: <select>

  20. Q: What tag defines an option in a dropdown list?
    A: <option>


Forms and Inputs (41–60)

  1. Q: What is the default method of a form?
    A: GET

  2. Q: How do you create a password input field?
    A: <input type="password">

  3. Q: What is the use of the <label> tag?
    A: Labels an input element

  4. Q: How do you group related inputs?
    A: Using <fieldset>

  5. Q: How do you define a caption for a <fieldset>?
    A: <legend>

  6. Q: How do you disable an input?
    A: Add disabled attribute

  7. Q: How do you make an input required?
    A: Add required attribute

  8. Q: How do you create a submit button?
    A: <button type="submit">

  9. Q: What tag is used to embed external content?
    A: <iframe>

  10. Q: What is the use of the placeholder attribute?
    A: Provides a hint in input fields

  11. Q: How do you set a maximum length for an input field?
    A: maxlength="value"

  12. Q: How do you pre-fill a value in a field?
    A: Using value="text"

  13. Q: What is the use of readonly attribute?
    A: Makes input non-editable but sendable

  14. Q: What is the use of the <datalist> tag?
    A: Defines options for input suggestions

  15. Q: How do you create a file upload input?
    A: <input type="file">

  16. Q: What is the use of the <button> tag?
    A: Creates a clickable button

  17. Q: How do you reset form inputs?
    A: <input type="reset">

  18. Q: What is the name attribute used for?
    A: Identifies form input for backend

  19. Q: What tag adds inline quotations?
    A: <q>

  20. Q: What tag adds block quotations?
    A: <blockquote>


HTML5 and Semantic Tags (61–80)

  1. Q: What is a semantic tag?
    A: A tag that clearly describes its meaning

  2. Q: What does <article> represent?
    A: Self-contained content

  3. Q: What does <section> represent?
    A: A section in a document

  4. Q: What does <nav> represent?
    A: Navigation links

  5. Q: What does <header> represent?
    A: A container for introductory content

  6. Q: What does <footer> represent?
    A: Footer content

  7. Q: What does <main> represent?
    A: Main content of the document

  8. Q: What does <aside> represent?
    A: Side content or sidebar

  9. Q: What tag defines a figure with caption?
    A: <figure> and <figcaption>

  10. Q: What tag is used for time-related content?
    A: <time>

  11. Q: What is the <mark> tag used for?
    A: Highlighting text

  12. Q: What is the <progress> tag used for?
    A: Displays a progress bar

  13. Q: What is the <meter> tag used for?
    A: Displays a scalar measurement

  14. Q: What tag defines a dialog box?
    A: <dialog>

  15. Q: What is the <summary> tag used for?
    A: Defines a summary for <details>

  16. Q: What does <details> do?
    A: Creates a collapsible element

  17. Q: Which tag is used to embed audio?
    A: <audio>

  18. Q: Which tag is used to embed video?
    A: <video>

  19. Q: What attribute makes media autoplay?
    A: autoplay

  20. Q: What is the controls attribute for?
    A: Displays audio/video controls


Miscellaneous (81–100)

  1. Q: Can HTML be used to

style content?
A: Only with inline styles (CSS is preferred)

  1. Q: How do you comment in HTML?
    A: <!-- comment -->

  2. Q: Is HTML case-sensitive?
    A: No, but lowercase is recommended

  3. Q: What tag is used to define keyboard input?
    A: <kbd>

  4. Q: What tag defines code snippets?
    A: <code>

  5. Q: What tag defines preformatted text?
    A: <pre>

  6. Q: What is a DOCTYPE?
    A: Declares the HTML version

  7. Q: What is the correct HTML5 doctype?
    A: <!DOCTYPE html>

  8. Q: What is the use of <span>?
    A: Applies style to inline content

  9. Q: What is the use of <div>?
    A: Groups block-level elements

  10. Q: How do you link a CSS file to HTML?
    A: <link rel="stylesheet" href="style.css">

  11. Q: Can JavaScript be used in HTML?
    A: Yes, using <script> tag

  12. Q: What tag defines an abbreviation?
    A: <abbr>

  13. Q: How do you create a tooltip?
    A: Use the title attribute

  14. Q: What does href in <a> stand for?
    A: Hypertext REFerence

  15. Q: What does <noscript> do?
    A: Displays content if JavaScript is disabled

  16. Q: What does <base> tag do?
    A: Sets the base URL for all links

  17. Q: What is character encoding?
    A: Defines how characters are stored

  18. Q: How do you specify character encoding in HTML5?
    A: <meta charset="UTF-8">

  19. Q: Can HTML work without CSS and JS?
    A: Yes, but it will be plain and unstyled


No comments:

Post a Comment