HTML - Set 1

HTML Coding Questions & Answers

HTML Coding Questions & Answers

Beginner Level

Q1. Create a basic HTML page.
<!DOCTYPE html>
<html>
<head>
  <title>My First Page</title>
</head>
<body>
  Hello World
</body>
</html>
Q2. Display your name in a heading and your role in a paragraph.
<h1>Vijay</h1>
<p>Web Developer</p>
Q3. Write HTML code to create an ordered list.
<ol>
  <li>HTML</li>
  <li>CSS</li>
  <li>JavaScript</li>
</ol>
Q4. Add a horizontal line and a line break.
<hr>
Line one<br>
Line two
Q5. Display an image with alternate text.
<img src="photo.jpg" alt="Profile Image">

Intermediate Level

Q6. Create a hyperlink that opens in a new tab.
<a href="https://www.google.com" target="_blank">Google</a>
Q7. Create a table with name and age.
<table border="1">
  <tr>
    <th>Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Vijay</td>
    <td>25</td>
  </tr>
</table>
Q8. Create a login form.
<form>
  <input type="text" placeholder="Username"><br>
  <input type="password" placeholder="Password"><br>
  <input type="submit" value="Login">
</form>
Q9. Create radio buttons for gender selection.
<input type="radio" name="gender"> Male
<input type="radio" name="gender"> Female
Q10. Create a dropdown list.
<select>
  <option>India</option>
  <option>USA</option>
  <option>UK</option>
</select>

Advanced Level

Q11. Create a semantic webpage layout.
<header>Header</header>

<nav>
  <a href="#">Home</a>
</nav>

<section>
  <article>Main Content</article>
</section>

<footer>© 2025</footer>
Q12. Create a form with required email validation.
<form>
  <input type="email" required placeholder="Enter email">
  <input type="submit">
</form>
Q13. Create an input field that is readonly and disabled.
<input type="text" value="Readonly" readonly>
<input type="text" value="Disabled" disabled>
Q14. Embed a YouTube video.
<iframe width="300" height="200"
src="https://www.youtube.com/embed/dQw4w9WgXcQ">
</iframe>
Q15. Create an editable paragraph.
<p contenteditable="true">
Edit this text
</p>

No comments:

Post a Comment