Category: Interview Question

  • meta tags in HTML?

    Meta tags give information about a webpage (SEO, charset, author).

    ✔ Example:

    <meta charset="UTF-8">
    <meta name="description" content="Learn HTML easily">
    <meta name="keywords" content="HTML, Web Development, Coding">
    <meta name="author" content="Saim">
    

  • What are HTML Entities?

    Entities are used to display reserved characters.

    ✔ Example:

    • &lt; = <
    • &gt; = >
    • &amp; = &
    • &nbsp; = space
    <p>5 &lt; 10</p>
  • What are HTML Forms?

    Forms are used to collect user input (like login, signup, search).
    Elements include: <input>, <textarea>, <select>, <button>.

    ✔ Example:

    <form>
      Name: <input type="text" name="username"><br>
      Password: <input type="password" name="password"><br>
      <button type="submit">Login</button>
    </form>
    
  • and <class>

    • id: Unique, used for one element.
    • class: Can be used for multiple elements.

    ✔ Example:

    <p id="intro">This is unique.</p>
    <p class="highlight">This is styled text.</p>
    <p class="highlight">Another styled text.</p>
    

  • <div> and <span>

    • <div> = block-level container (used for sections).
    • <span> = inline container (used for styling text).
  • Block-level and Inline elements?

    • Block-level elements: Start on a new line, take full width. Examples: <div>, <p>, <h1>.
    • Inline elements: Stay within a line, take only needed space. Examples: <span>, <a>, <strong>.

    ✔ Example:

    <p>This is <span style="color:red;">inline text</span> inside a paragraph.</p>
    
  • Semantic Tags in HTML5?

    Semantic tags describe the meaning of the content.
    Examples:

    • <header> → page header
    • <nav> → navigation links
    • <article> → independent content
    • <footer> → page footer

    ✔ Example:

    <header>My Website</header>
    <nav>Home | About | Contact</nav>
    <article>
      <h2>Blog Post</h2>
      <p>This is a blog post.</p>
    </article>
    <footer>© 2025 MySite</footer>
    

  • HTML and HTML5?

    • HTML: Older versions, less multimedia support.
    • HTML5: Modern version with support for audio, video, canvas, local storage, and semantic tags.

    ✔ Example of HTML5 tags:

    <video controls>
      <source src="video.mp4" type="video/mp4">
    </video>
    
    <article>
      <h2>News Article</h2>
      <p>This is semantic HTML.</p>
    </article>
    
  • HTML Tags and Attributes?

    • Tags define elements in HTML (e.g., <p> for paragraph).
    • Attributes give extra information to tags (e.g., src in <img>).

    ✔ Example:

    <img src="photo.jpg" alt="Profile Photo" width="200">
    
    • <img> → tag
    • src, alt, width → attributes
  • What is HTML?

    HTML (HyperText Markup Language) is the standard language used to create the structure of web pages.
    It uses tags (like <p>, <h1>, <img>) to define elements.

    ✔ Example:

    <!DOCTYPE html>
    <html>
    <head>
      <title>My First Page</title>
    </head>
    <body>
      <h1>Hello, World!</h1>
      <p>This is a paragraph.</p>
    </body>
    </html>