Code Challenges
Code challenges for HTML. Each challenge links to its lesson page where you can solve it with live code execution.
35 challenges · 4 lessons01introduction
9 challengesWrite an HTML <p> element that displays the text "Welcome to HTML".easyWrite a basic HTML5 document with <!DOCTYPE html>, <html>, <head>, and <body> elements. Set the page title to "My Website" using the <title> element.easyWrite an HTML <a> element that links to "https://example.com" and displays the text "Visit Website".easyWrite an HTML <h1> element displaying "About HTML" and a <p> element displaying "HTML structures web pages.".easyWrite an HTML <img> element with src set to "photo.jpg" and alt set to "A beautiful landscape".easyWrite an HTML unordered list using <ul> and <li> elements with two items: "HTML" and "CSS".easyWrite an HTML <a> element that links to "https://www.example.com" and displays the text "Open Example".easyWrite an HTML <h1> element that displays the text "My First Page".easyWrite a complete HTML page with an <h1> heading "Welcome" and a <p> paragraph saying "Hello World".medium
02HTML Editors
6 challengesWrite the following HTML structure with proper indentation: a body containing a div, and inside the div an h2 element with the text "About Us".easyWrite the basic HTML document structure using <!DOCTYPE html>, <html>, <head>, and <body> tags.easyComplete the anchor element so that it links to https://example.com and displays the text "Visit Website".easyWrite an <h1> element displaying "Welcome to HTML" and a <p> element displaying "I am learning HTML." inside the <body> element.easyCreate a complete HTML document using <!DOCTYPE html>, <html>, <head>, and <body> elements. Set the page title to "My First Website" using the <title> element. Inside the <body>, add an <h1> heading displaying "Hello World" and a <p> paragraph displaying "This is my first web page."easyThe following HTML code has an incorrect closing tag. Rewrite it with the correct closing tag: <strong>Important Notice</p>easy
03HTML Basic
10 challengesWrite an HTML <p> element containing the text "Learning HTML".easyWrite HTML Code to display a Heading using <h1>.easyCreate two separate Paragraphs.easyCreate an <a> element linking to https://www.example.com with the text "Example Website".easyWrite an <img> element with src="logo.png" and alt="Company logo".easyCreate a Link that navigates to https://www.example.com.mediumAdd an Image with meaningful alt Text.mediumWrite the HTML element that inserts a thematic break.easyCreate a <button> element displaying the text "Submit".easyCreate a complete HTML Page containing a Title, three Headings, three Paragraphs, one Link, one Image, one thematic break, and one Button.challenge
04HTML Elements
10 challengesWrite an HTML <h1> element that displays the text "Welcome to HTML".easyWrite an HTML <h1> element that displays the text "My First Page".easyWrite an HTML <p> element that displays the text "HTML is easy to learn.".easyWrite an HTML <p> element that displays the text "Welcome to HTML".easyWrite an HTML <a> element that displays the text "Visit Google" and links to "https://www.google.com" using the href attribute.easyWrite an HTML <a> element that displays the text "Visit Google" and links to "https://www.google.com".easyWrite an HTML <img> element that displays an image from "photo.jpg" and has the alt text "A beautiful flower".easyWrite an HTML <img> element that displays an image from "photo.jpg" and uses "My Photo" as its alt text.mediumWrite an HTML unordered list using <ul> and <li> elements that contains three items: "HTML", "CSS", and "JavaScript".easyWrite an HTML unordered list using <ul> and <li> elements that contains three items: "HTML", "CSS", and "JavaScript".medium