• HTML Tutorial
  • HTML Exercises
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • DOM Audio/Video
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
  • HTML Introduction
  • HTML Editors
  • HTML Basics
  • HTML Comments
  • HTML Elements
  • HTML Headings
  • HTML Paragraphs
  • HTML Text Formatting
  • HTML Quotations
  • HTML Colors
  • HTML Links Hyperlinks
  • HTML Images
  • HTML Favicon
  • HTML Tables
  • HTML Ordered Lists
  • HTML Unordered Lists
  • HTML Description Lists
  • HTML Block and Inline Elements
  • HTML Iframes
  • HTML File Paths
  • HTML Layout
  • HTML Computer Code Elements
  • HTML5 Semantics
  • HTML Entities
  • HTML Symbols
  • HTML Emojis
  • HTML Charsets
  • HTML URL Encoding
  • HTML Responsive Web Design

HTML Graphics

  • SVG Tutorial

HTML Tutorial References

  • HTML Tags - A to Z List
  • HTML Attributes Complete Reference
  • HTML Global Attributes
  • HTML5 Complete Reference
  • HTML5 MathML Complete Reference
  • HTML DOM Complete Reference
  • HTML DOM Audio/Video Complete Reference
  • SVG Element Complete Reference
  • SVG Attribute Complete Reference
  • SVG Property Complete Reference
  • HTML Canvas Complete Reference

HTML Exercises, Practice Questions and Solutions

Are you eager to learn HTML or looking to brush up on your skills? Dive into our HTML Exercises , designed to cater to both beginners and experienced developers. With our interactive portal, you can engage in hands-on coding challenges, track your progress, and elevate your web development expertise. Whether you’re starting from scratch or aiming to refine your HTML knowledge, our practice questions and solutions offer a step-by-step guide to success.

A step-by-step HTML practice guide for beginner to advanced level.

Benefits of HTML Exercises

  • Interactive Quizzes: Engage in hands-on HTML quizzes.
  • Progress Tracking: Monitor your learning journey.
  • Skill Enhancement: Sharpen coding skills effectively.
  • Flexible Learning: Practice at your own pace.
  • Immediate Feedback: Receive instant results and feedback.
  • Convenient Accessibility: Accessible online, anytime.
  • Real-world Application: Apply HTML concepts practically.
  • Comprehensive Learning: Cover a range of HTML topics.

How to Start Practice ?:

Embark on your HTML learning journey by accessing our online practice portal. Choose exercises suited to your skill level, dive into coding challenges, and receive immediate feedback to reinforce your understanding. Our user-friendly platform makes learning HTML engaging and personalized, allowing you to develop your skills effectively.

HTML Best Practice Guide:

Dive into HTML excellence with our comprehensive Best Practice Guide. Uncover essential coding standards, optimization tips, and industry-recommended approaches to HTML development. Elevate your skills with insightful advice, practical examples, and interactive challenges. Ensure your web projects stand out for their clarity and performance by following these proven best practices.

Why Practice HTML Online?

  • Hands-On Learning : Immerse yourself in interactive HTML exercises to gain practical experience.
  • Progress Tracking : Monitor your learning journey and see how your skills improve over time.
  • Flexible Practice : Learn at your own pace, anytime and anywhere with convenient online accessibility.
  • Real-World Application : Apply HTML concepts to real projects, enhancing your ability to create websites.
  • Comprehensive Coverage : Explore a variety of HTML topics, from basic syntax to advanced techniques.

HTML Online Practice Rules:

  • Be Honest : Complete exercises independently, avoiding plagiarism or unauthorized help.
  • Time Management : Adhere to time limits to simulate real-world scenarios effectively.
  • Code Quality : Prioritize clean, efficient, and well-structured HTML code.
  • Follow Guidelines : Adhere to platform instructions for input/output formats and code submission.
  • No Cheating : Refrain from using external resources during assessments, unless explicitly permitted.
  • Utilize Feedback : Learn from automated feedback and engage with the community for support.
  • Active Participation : Join forums, discussions, and share insights with fellow learners to enhance your understanding.
  • Continuous Improvement : Identify and address areas of weakness for ongoing growth and development.

Features of Practice Portal:

  • Immediate Feedback : Receive instant feedback on mistakes to facilitate quick learning.
  • Unlimited Attempts : Practice exercises multiple times to master HTML concepts.
  • Time Management Tools : Display elapsed time for each set of exercises to help manage time effectively.
  • Performance Analytics : Track your progress with detailed analytics, highlighting strengths and areas for improvement.
  • Interactive Code Editor : Experience an immersive coding environment for hands-on practice.
  • Hints and Solutions : Access hints and solutions to guide your learning process.
  • Community Integration : Engage with peers through forums and discussions for collaborative learning.
  • Adaptive Difficulty : Adjust exercise difficulty based on user performance for personalized challenges.
  • Gamification Elements : Earn scores, achievements, or badges to make learning HTML engaging and fun.

Please Login to comment...

Similar reads.

  • WebTech - Exercises
  • Web Technologies

advertisewithusBannerImg

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Programming Tricks

  • HTML Lab Assignments

HTML Assignment and HTML Examples for Practice

Text formatting, working with image, working with link.

The HTML Handbook – Learn HTML for Beginners

Flavio Copes

Introduction

Welcome! I wrote this book to help you quickly learn HTML and get familiar with the advanced HTML topics.

HTML, a shorthand for Hyper Text Markup Language, is one of the most fundamental building blocks of the Web.

HTML was officially born in 1993 and since then it evolved into its current state, moving from simple text documents to powering rich Web Applications.

This handbook is aimed at a vast audience.

First, the beginner. I explain HTML from zero in a succinct but comprehensive way, so you can use this book to learn HTML from the basics.

Then, the professional. HTML is often considered like a secondary thing to learn. It might be given for granted.

Yet lots of things are obscure to many people. Me included. I wrote this handbook to help my understanding of the topic, because when I need to explain something, I better make sure I first know the thing inside out.

Even if you don't write HTML in your day to day work, knowing how HTML works can help save you some headaches when you need to understand it from time to time, for example while tweaking a web page.

You can reach me on Twitter @flaviocopes .

My website is flaviocopes.com .

Note: you can download a PDF / ePub / Mobi version of this book so you can read it offline.

  • HTML Basics
  • The document heading
  • The document body
  • Tags that interact with text
  • Container tags and page structure HTML
  • Multimedia tags: audio and video
  • Accessibility

HTML is the foundation of the marvel called the Web.

There is an incredible power underneath this rather simple and limited set of rules, which lets us -- developers, makers, designers, writers, and tinkerers -- craft documents, apps, and experiences for people all around the globe.

My first HTML book came out in 1997 and was called "HTML Unleashed". A big, lots-of-pages, long tome.

20+ years have passed, and HTML is still the foundation of the Web, with minimal changes from back then.

Sure, we got more semantic tags, presentational HTML is no longer a thing, and CSS has taken care of the design of things.

HTML's success is based on one thing: simplicity .

It resisted being hijacked into an XML dialect via XHTML, when eventually people realized that thing was way, way too complex.

It did so because of another feature it provides us: forgiveness . There are some rules, right, but after you learn those, you have a lot of freedom.

Browsers learned to be resilient and to always try to do their best when parsing and presenting HTML to the users.

And the whole Web platform did one thing right: it never broke backward compatibility. Pretty incredibly, we can go back to HTML documents written in 1991, and they look pretty much as they looked back then.

We even know what the first web page was. It's this: http://info.cern.ch/hypertext/WWW/TheProject.html

And you can see the source of the page, thanks to another big feature of the Web and HTML: we can inspect the HTML of any web page .

Don't take this for granted. I don't know any other platform that gives us this ability.

The exceptional Developer Tools built into any browser let us inspect and take inspiration from HTML written by anyone in the world.

If you are new to HTML this book aims to help you get started. If you are a seasoned Web Developer this book will improve your knowledge.

I learned so much while writing it, even though I've been working with the Web for 20+ years, and I'm sure you'll find something new, too.

Or you'll re-learn something old you forgot.

In any case, the goal of the book is to be useful to you, and I hope it succeeds.

HTML BASICS

HTML is a standard defined by the WHATWG , an acronym for Web Hypertext Application Technology Working Group, an organization formed by people working on the most popular web browser. This means it's basically controlled by Google, Mozilla, Apple and Microsoft.

In the past the W3C (World Wide Web Consortium) was the organization in charge of creating the HTML standard.

The control informally moved from W3C to WHATWG when it became clear that the W3C push towards XHTML was not a good idea.

If you've never heard of XHTML, here's a short story. In the early 2000s, we all believed the future of the Web was XML (seriously). So HTML moved from being an SGML-based authoring language to an XML markup language.

It was a big change. We had to know, and respect, more rules. Stricter rules.

Eventually browser vendors realized this was not the right path for the Web, and they pushed back, creating what is now known as HTML5.

W3C did not really agree on giving up control of HTML, and for years we had 2 competing standards, each one aiming to be the official one. Eventually on 28 May 2019 it was made official by W3C that the "true" HTML version was the one published by WHATWG.

I mentioned HTML5. Let me explain this little story. I know, it's kind of confusing up to now, as with many things in life when many actors are involved, yet it's also fascinating.

We had HTML version 1 in 1993. Here's the original RFC .

HTML 2 followed in 1995.

We got HTML 3 in January 1997, and HTML 4 in December 1997.

Busy times!

20+ years went by, we had this entire XHTML thing, and eventually we got to this HTML5 "thing", which is not really just HTML any more.

HTML5 is a term that now defines a whole set of technologies, which includes HTML but adds a lot of APIs and standards like WebGL, SVG and more.

The key thing to understand here is this: there is no such thing (any more) as an HTML version now. It's a living standard. Like CSS, which is called "3", but in reality is a bunch of independent modules developed separately. Like JavaScript, where we have one new edition each year, but nowadays, the only thing that matters is which individual features are implemented by the engine.

Yes we call it HTML5, but HTML4 is from 1997. That's a long time for anything, let alone for the web.

This is where the standard now "lives": https://html.spec.whatwg.org/multipage .

HTML is the markup language we use to structure content that we consume on the Web.

HTML is served to the browser in different ways.

  • It can be generated by a server-side application that builds it depending on the request or the session data, for example a Rails or Laravel or Django application.
  • It can be generated by a JavaScript client-side application that generates HTML on the fly.
  • In the simplest case, it can be stored in a file and served to the browser by a Web server.

Let's dive into this last case. Although in practice it's probably the least popular way to generate HTML, it's still essential to know the basic building blocks.

By convention, an HTML file is saved with a .html or .htm extension.

Inside this file, we organize the content using tags .

Tags wrap the content, and each tag gives a special meaning to the text it wraps.

Let's make a few examples.

This HTML snippet creates a paragraph using the p tag:

This HTML snippet creates a list of items using the ul tag, which means unordered list , and the li tags, which mean list item :

When an HTML page is served by the browser, the tags are interpreted, and the browser renders the elements according to the rules that define their visual appearance.

Some of those rules are built-in, such as how a list renders or how a link is underlined in blue.

Some other rules are set by you with CSS.

HTML is not presentational. It's not concerned with how things look . Instead, it's concerned with what things mean .

It's up to the browser to determine how things look, with the directives defined by who builds the page, with the CSS language.

Now, those two examples I made are HTML snippets taken outside of a page context.

HTML page structure

Let's make an example of a proper HTML page.

Things start with the Document Type Declaration (aka doctype ), a way to tell the browser this is an HTML page, and which version of HTML we are using.

Modern HTML uses this doctype:

Then we have the html element, which has an opening and closing tag:

Most tags come in pairs with an opening tag and a closing tag. The closing tag is written the same as the opening tag, but with a / :

There are a few self-closing tags, which means they don't need a separate closing tag as they don't contain anything in them .

The html starting tag is used at the beginning of the document, right after the document type declaration.

The html ending tag is the last thing present in an HTML document.

Inside the html element we have 2 elements: head and body :

Inside head we will have tags that are essential to creating a web page, like the title, the metadata, and internal or external CSS and JavaScript. Mostly things that do not directly appear on the page, but only help the browser (or bots like the Google search bot) display it properly.

Inside body we will have the content of the page. The visible stuff .

Tags vs elements

I mentioned tags and elements. What's the difference?

Elements have a starting tag and a closing tag. In this example, we use the p starting and closing tags to create a p element:

So, an element constitutes the whole package :

  • starting tag
  • text content (and possibly other elements)
  • closing tag

If an element has doesn't have a closing tag, it is only written with the starting tag, and it cannot contain any text content.

That said, I might use the tag or element term in the book meaning the same thing, except if I explicitly mention starting tag or ending tag.

The starting tag of an element can have special snippets of information we can attach, called attributes .

Attributes have the key="value" syntax:

You can also use single quotes, but using double quotes in HTML is a nice convention.

We can have many of them:

and some attributes are boolean, meaning you only need the key:

The class and id attributes are two of the most common you will find used.

They have a special meaning, and they are useful both in CSS and JavaScript.

The difference between the two is that an id is unique in the context of a web page; it cannot be duplicated.

Classes, on the other hand, can appear multiple times on multiple elements.

Plus, an id is just one value. class can hold multiple values, separated by a space:

It's common to use the dash - to separate words in a class value, but it's just a convention.

Those are just two of the possible attributes you can have. Some attributes are only used for one tag. They are highly specialized.

Other attributes can be used in a more general way. You just saw id and class , but we have other ones too, like style which can be used to insert inline CSS rules on an element.

Case insensitive

HTML is case insensitive. Tags can be written in all caps, or lowercase. In the early days, caps were the norm. Today lowercase is the norm. It is a convention.

You usually write like this:

not like this:

White space

Pretty important. In HTML, even if you add multiple white spaces into a line, it's collapsed by the browser's CSS engine.

For example the rendering of this paragraph:

is the same as this:

and the same as this:

> Using the white-space CSS property you can change how things behave. You can find more information on how CSS processes white space in the CSS Spec

I typically favor

Nested tags should be indented with 2 or 4 characters, depending on your preference:

Note: this "white space is not relevant" feature means that if you want to add additional space, it can make you pretty mad. I suggest you use CSS to make more space when needed.

Note: in special cases, you can use the   HTML entity (an acronym that means non-breaking space ) - more on HTML entities later on. I think this should not be abused. CSS is always preferred to alter the visual presentation.

THE DOCUMENT HEADING

The head tag contains special tags that define the document properties.

It's always written before the body tag, right after the opening html tag:

We never use attributes on this tag. And we don't write content in it.

It's just a container for other tags. Inside it we can have a wide variety of tags, depending on what you need to do:

The title tag

The title tag determines the page title. The title is displayed in the browser, and it's especially important as it's one of the key factors for Search Engine Optimization (SEO).

The script tag

This tag is used to add JavaScript into the page.

You can include it inline, using an opening tag, the JavaScript code and then the closing tag:

Or you can load an external JavaScript file by using the src attribute:

The type attribute by default is set to text/javascript , so it's completely optional.

There is something pretty important to know about this tag.

Sometimes this tag is used at the bottom of the page, just before the closing </body> tag. Why? For performance reasons.

Loading scripts by default blocks the rendering of the page until the script is parsed and loaded.

By putting it at the bottom of the page, the script is loaded and executed after the whole page is already parsed and loaded, giving a better experience to the user over keeping it in the head tag.

My opinion is that this is now bad practice. Let script live in the head tag.

In modern JavaScript we have an alternative this is more performant than keeping the script at the bottom of the page -- the defer attribute. This is an example that loads a file.js file, relative to the current URL:

This is the scenario that triggers the faster path to a fast-loading page, and fast-loading JavaScript.

Note: the async attribute is similar, but in my opinion a worse option than defer . I describe why, in more detail, on page https://flaviocopes.com/javascript-async-defer/

The noscript tag

This tag is used to detect when scripts are disabled in the browser.

Note: users can choose to disable JavaScript scripts in the browser settings. Or the browser might not support them by default.

It is used differently depending on whether it's put in the document head or in the document body.

We're talking about the document head now, so let's first introduce this usage.

In this case, the noscript tag can only contain other tags:

to alter the resources served by the page, or the meta information, if scripts are disabled.

In this example I set an element with the no-script-alert class to display if scripts are disabled, as it was display: none by default:

Let's solve the other case: if put in the body, it can contain content, like paragraphs and other tags, which are rendered in the UI.

The link tag

The link tag is used to set relationships between a document and other resources.

It's mainly used to link an external CSS file to be loaded.

This element has no closing tag.

The media attribute allows the loading of different stylesheets depending on the device capabilities:

We can also link to resources other than stylesheets.

For example we can associate an RSS feed using

Or we can associate a favicon using:

This tag was also used for multi-page content, to indicate the previous and next page using rel="prev" and rel="next" . Mostly for Google. As of 2019, Google announced it does not use this tag any more because it can find the correct page structure without it.

The style tag

This tag can be used to add styles into the document, rather than loading an external stylesheet.

As with the link tag, you can use the media attribute to use that CSS only on the specified medium:

The base tag

This tag is used to set a base URL for all relative URLs contained in the page.

The meta tag

Meta tags perform a variety of tasks and they are very, very important.

Especially for SEO.

meta elements only have the starting tag.

The most basic one is the description meta tag:

This might be used by Google to generate the page description in its result pages, if it finds it better describes the page than the on-page content (don't ask me how).

The charset meta tag is used to set the page character encoding. utf-8 in most cases:

The robots meta tag instructs the Search Engine bots whether to index a page or not:

Or if they should follow links or not:

You can set nofollow on individual links, too. This is how you can set nofollow globally.

You can combine them:

The default behavior is index, follow .

You can use other properties, including nosnippet , noarchive , noimageindex and more.

You can also just tell Google instead of targeting all search engines:

And other search engines might have their own meta tag, too.

Speaking of which, we can tell Google to disable some features. This prevents the translate functionality in the search engine results:

The viewport meta tag is used to tell the browser to set the page width based on the device width.

See more about this tag .

Another rather popular meta tag is the http-equiv="refresh" one. This line tells the browser to wait 3 seconds, then redirect to that other page:

Using 0 instead of 3 will redirect as soon as possible.

This is not a full reference; Other less-used meta tags exist.

After this document heading introduction, we can start diving into the document body.

THE DOCUMENT BODY

After the closing head tag, we can only have one thing in an HTML document: the body element.

Just like the head and html tags, we can only have one body tag in one page.

Inside the body tag we have all the tags that define the content of the page.

Technically, the start and ending tags are optional. But I consider it a good practice to add them. Just for clarity.

In the next chapters we'll define the variety of tags you can use inside the page body.

But before, we must introduce a difference between block elements and inline elements.

Block elements vs inline elements

Visual elements, the ones defined in the page body, can be generally classified in 2 categories:

  • block elements ( p , div , heading elements, lists and list items, ...)
  • inline elements ( a , span , img , ...)

What is the difference?

Block elements, when positioned in the page, do not allow other elements next to them. To the left, or to the right.

Inline elements instead can sit next to other inline elements.

The difference also lies in the visual properties we can edit using CSS. We can alter the width/height, margin, padding and border of block elements. We can't do that for inline elements.

Note that using CSS we can change the default for each element, setting a p tag to be inline, for example, or a span to be a block element.

Another difference is that inline elements can be contained in block elements. The reverse is not true.

Some block elements can contain other block elements, but it depends. The p tag for example does not allow such option.

TAGS THAT INTERACT WITH TEXT

This tag defines a paragraph of text.

It's a block element.

Inside it, we can add any inline element we like, like span or a .

We cannot add block elements.

We cannot nest a p element into another one.

By default browsers style a paragraph with a margin on top and at the bottom. 16px in Chrome, but the exact value might vary between browsers.

This causes two consecutive paragraphs to be spaced, replicating what we think of a "paragraph" in printed text.

The span tag

This is an inline tag that can be used to create a section in a paragraph that can be targeted using CSS:

This tag represents a line break. It's an inline element, and does not need a closing tag.

We use it to create a new line inside a p tag, without creating a new paragraph.

And compared to creating a new paragraph, it does not add additional spacing.

The heading tags

HTML provides us 6 heading tags. From most important to least important, we have h1 , h2 , h3 , h4 , h5 , h6 .

Typically a page will have one h1 element, which is the page title. Then you might have one or more h2 elements depending on the page content.

Headings, especially the heading organization, are also essential for SEO, and search engines use them in various ways.

The browser by default will render the h1 tag bigger, and will make the elements size smaller as the number near h increases:

Screen-Shot-2019-06-11-at-19.46.57

All headings are block elements. They cannot contain other elements, just text.

The strong tag

This tag is used to mark the text inside it as strong . This is pretty important, it's not a visual hint, but a semantic hint. Depending on the medium used, its interpretation will vary.

Browsers by default make the text in this tag bold .

This tag is used to mark the text inside it as emphasized . Like with strong , it's not a visual hint but a semantic hint.

Browsers by default make the text in this italic .

The blockquote HTML tag is useful to insert citations in the text.

Browsers by default apply a margin to the blockquote element. Chrome applies a 40px left and right margin, and a 10px top and bottom margin.

The q HTML tag is used for inline quotes.

Horizontal line

Not really based on text, but the hr tag is often used inside a page. It means horizontal rule , and it adds a horizontal line in the page.

Useful to separate sections in the page.

Code blocks

The code tag is especially useful to show code, because browsers give it a monospaced font.

That's typically the only thing that browsers do. This is the CSS applied by Chrome:

This tag is typically wrapped in a pre tag, because the code element ignores whitespace and line breaks. Like the p tag.

Chrome gives pre this default styling:

which prevents white space collapsing and makes it a block element.

We have 3 types of lists:

  • unordered lists
  • ordered lists
  • definition lists

Unordered lists are created using the ul tag. Each item in the list is created with the li tag:

Ordered lists are similar, just made with the ol tag:

The difference between the two is that ordered lists have a number before each item:

Screen-Shot-2019-06-12-at-09.35.05

Definition lists are a bit different. You have a term, and its definition:

This is how browsers typically render them:

Screen-Shot-2019-06-12-at-09.45.21

I must say you rarely see them in the wild, for sure not much as ul and ol , but sometimes they might be useful.

Other text tags

There is a number of tags with presentational purposes:

  • the mark tag
  • the ins tag
  • the del tag
  • the sup tag
  • the sub tag
  • the small tag

This is an example of the visual rendering of them which is applied by default by browsers:

Screen-Shot-2019-06-12-at-08.43.55

You might wonder, how is b different than strong ? And how i is different than em ?

The difference lies in the semantic meaning. While b and i are a direct hint at the browser to make a piece of text bold or italic, strong and em give the text a special meaning, and it's up to the browser to give the styling. Which happens to be exactly the same as b and i , by default. Although you can change that using CSS.

There are a number of other, less used tags related to text. I just mentioned the ones that I see used the most.

Links are defined using the a tag. The link destination is set via its href attribute.

Between the starting and closing tag we have the link text.

The above example is an absolute URL. Links also work with relative URLs:

In this case, when clicking the link the user is moved to the /test URL on the current origin.

Be careful with the / character. If omitted, instead of starting from the origin, the browser will just add the test string to the current URL.

Example, I'm on the page https://flaviocopes.com/axios/ and I have these links:

  • /test once clicked brings me to https://flaviocopes.com/test
  • test once clicked brings me to https://flaviocopes.com/axios/test

Link tags can include other things inside them, not just text. For example, images:

or any other elements, except other <a> tags.

If you want to open the link in a new tab, you can use the target attribute:

CONTAINER TAGS AND PAGE STRUCTURE HTML

Container tags.

HTML provides a set of container tags. Those tags can contain an unspecified set of other tags.

and it can be confusing to understand the difference between them.

Let's see when to use each one of them.

The article tag identifies a thing that can be independent from other things in a page.

For example a list of blog posts in the homepage.

Or a list of links.

We're not limited to lists: an article can be the main element in a page.

Inside an article tag we should have a title ( h1 - h6 ) and

Represents a section of a document. Each section has a heading tag ( h1 - h6 ), then the section body .

It's useful to break a long article into different sections .

Shouldn't be used as a generic container element. div is made for this.

div is the generic container element:

You often add a class or id attribute to this element, to allow it to be styled using CSS.

We use div in any place where we need a container but the existing tags are not suited.

Tags related to page

This tag is used to create the markup that defines the page navigation. Into this we typically add an ul or ol list:

The aside tag is used to add a piece of content that is related to the main content.

A box where to add a quote, for example. Or a sidebar.

Using aside is a signal that the things it contains are not part of the regular flow of the section it lives into.

The header tag represents a part of the page that is the introduction. It can for example contain one or more heading tag ( h1 - h6 ), the tagline for the article, an image.

The main tag represents the main part of a page:

The footer tag is used to determine the footer of an article, or the footer of the page:

Forms are the way you can interact with a page, or an app, built with Web technologies.

You have a set of controls, and when you submit the form, either with a click to a "submit" button or programmatically, the browser will send the data to the server.

By default this data sending causes the page to reload after the data is sent, but using JavaScript you can alter this behavior (not going to explain how in this book).

A form is created using the form tag:

By default forms are submitted using the GET HTTP method. Which has its drawbacks, and usually you want to use POST.

You can set the form to use POST when submitted by using the method attribute:

The form is submitted, either using GET or POST, to the same URL where it resides.

So if the form is in the https://flaviocopes.com/contacts page, pressing the "submit" button will make a request to that same URL.

Which might result in nothing happening.

You need something server-side to handle the request, and typically you "listen" for those form submit events on a dedicated URL.

You can specify the URL via the action parameter:

This will cause the browser to submit the form data using POST to the /new-contact URL on the same origin.

If the origin (protocol + domain + port) is https://flaviocopes.com (port 80 is the default), this means the form data will be sent to https://flaviocopes.com/new-contact .

I talked about data. Which data?

Data is provided by users via the set of controls that are available on the Web platform:

  • input boxes (single line text)
  • text areas (multiline text)
  • select boxes (choose one option from a drop-down menu)
  • radio buttons (choose one option from a list always visible)
  • checkboxes (choose zero, one or more option)
  • file uploads

Let's introduce each one of them in the following form fields overview.

The input tag

The input field is one of the most widely used form elements. It's also a very versatile element, and it can completely change behavior based on the type attribute.

The default behavior is to be a single-line text input control:

Equivalent to using:

As with all the other fields that follow, you need to give the field a name in order for its content to be sent to the server when the form is submitted:

The placeholder attribute is used to have some text showing up, in light gray, when the field is empty. Useful to add a hint to the user for what to type in:

Using type="email" will validate client-side (in the browser) an email for correctness (semantic correctness, not ensuring the email address is existing) before submitting.

Using type="password" will make every key entered appear as an asterisk (*) or dot, useful for fields that host a password.

You can have an input element accept only numbers:

You can specify a minimum and maximum value accepted:

The step attribute helps identify the steps between different values. For example this accepts a value between 10 and 50, at steps of 5:

Hidden field

Fields can be hidden from the user. They will still be sent to the server upon the form submit:

This is commonly used to store values like a CSRF token, used for security and user identification, or even to detect robots sending spam, using special techniques.

It can also just be used to identify a form and its action.

Setting a default value

All those fields accept a predefined value. If the user does not change it, this will be the value sent to the server:

If you set a placeholder, that value will appear if the user clears the input field value:

Form submit

The type="submit" field is a button that, once pressed by the user, submits the form:

The value attribute sets the text on the button, which if missing shows the "Submit" text:

Form validation

Browsers provide client-side validation functionality to forms.

You can set fields as required, ensuring they are filled, and enforce a specific format for the input of each field.

Let's see both options.

Set fields as required

The required attribute helps you with validation. If the field is not set, client-side validation fails and the browser does not submit the form:

Enforce a specific format

I described the type="email" field above. It automatically validates the email address according to a format set in the specification.

In the type="number" field, I mentioned the min and max attribute to limit values entered to an interval.

You can do more.

You can enforce a specific format on any field.

The pattern attribute gives you the ability to set a regular expression to validate the value against.

I recommend reading my Regular Expressions Guide at flaviocopes.com/javascript-regular-expressions/ .

pattern=" https://.* "

Other fields

File uploads.

You can load files from your local computer and send them to the server using a type="file" input element:

You can attach multiple files:

You can specify one or more file types allowed using the accept attribute. This accepts images:

You can use a specific MIME type, like application/json or set a file extension like .pdf . Or set multiple file extensions, like this:

The type="button" input fields can be used to add additional buttons to the form, that are not submit buttons:

They are used to programmatically do something, using JavaScript.

There is a special field rendered as a button, whose special action is to clear the entire form and bring back the state of the fields to the initial one:

Radio buttons

Radio buttons are used to create a set of choices, of which one is pressed and all the others are disabled.

The name comes from old car radios that had this kind of interface.

You define a set of type="radio" inputs, all with the same name attribute, and different value attribute:

Once the form is submitted, the color data property will have one single value.

There's always one element checked. The first item is the one checked by default.

You can set the value that's pre-selected using the checked attribute. You can use it only once per radio inputs group.

Similar to radio boxes, but they allow multiple values to be chosen, or none at all.

You define a set of type="checkbox" inputs, all with the same name attribute, and different value attribute:

All those checkboxes will be unchecked by default. Use the checked attribute to enable them on page load.

Since this input field allows multiple values, upon form submit the value(s) will be sent to the server as an array.

Date and time

We have a few input types to accept date values.

The type="date" input field allows the user to enter a date, and shows a date picker if needed:

The type="time" input field allows the user to enter a time, and shows a time picker if needed:

The type="month" input field allows the user to enter a month and a year:

The type="week" input field allows the user to enter a week and a year:

All those fields allow to limit the range and the step between each value. I recommend checking MDN for the little details on their usage.

The type="datetime-local" field lets you choose a date and a time.

Here is a page to test them all: https://codepen.io/flaviocopes/pen/ZdWQPm

Color picker

You can let users pick a color using the type="color" element:

You set a default value using the value attribute:

The browser will take care of showing a color picker to the user.

This input element shows a slider element. People can use it to move from a starting value to an ending value:

You can provide an optional step:

The type="tel" input field is used to enter a phone number:

The main selling point for using tel over text is on mobile, where the device can choose to show a numeric keyboard.

Specify a pattern attribute for additional validation:

The type="url" field is used to enter a URL.

You can validate it using the pattern attribute:

The textarea tag

The textarea element allows users to enter multi-line text. Compared to input , it requires an ending tag:

You can set the dimensions using CSS, but also using the rows and cols attributes:

As with the other form tags, the name attribute determines the name in the data sent to the server:

The select tag

This tag is used to create a drop-down menu.

The user can choose one of the options available.

Each option is created using the option tag. You add a name to the select, and a value to each option:

You can set an option disabled:

You can have one empty option:

Options can be grouped using the optgroup tag. Each option group has a label attribute:

In the early days of the web tables were a very important part of building layouts.

Later on they were replaced by CSS and its layout capabilities, and today we have powerful tools like CSS Flexbox and CSS Grid to build layouts. Tables are now used just for, guess what, building tables!

The table tag

You define a table using the table tag:

Inside the table we'll define the data. We reason in terms of rows, which means we add rows into a table (not columns). We'll define columns inside a row.

A row is added using the tr tag, and that's the only thing we can add into a table element:

This is a table with 3 rows.

The first row can take the role of the header.

Column headers

The table header contains the name of a column, typically in a bold font.

Think about an Excel / Google Sheets document. The top A-B-C-D... header.

Screen-Shot-2019-06-20-at-10.18.17

We define the header using the th tag:

The table content

The content of the table is defined using td tags, inside the other tr elements:

This is how browsers render it, if you don't add any CSS styling:

Screen-Shot-2019-06-20-at-10.24.08

Adding this CSS:

makes the table look more like a proper table:

Screen-Shot-2019-06-20-at-10.26.15

Span columns and rows

A row can decide to span over 2 or more columns, using the colspan attribute:

Screen-Shot-2019-06-20-at-10.27.59

Or it can span over 2 or more rows, using the rowspan attribute:

Screen-Shot-2019-06-20-at-10.29.37

Row headings

Before I explained how you can have column headings, using the th tag inside the first tr tag of the table.

You can add a th tag as the first element inside a tr that's not the first tr of the table, to have row headings:

Screen-Shot-2019-06-20-at-10.49.16

More tags to organize the table

You can add 3 more tags into a table, to have it more organized.

This is best when using big tables. And to properly define a header and a footer, too.

Those tags are

They wrap the tr tags to clearly define the different sections of the table. Here's an example:

Screen-Shot-2019-06-20-at-10.52.41

Table caption

A table should have a caption tag that describes its content. That tag should be put immediately after the opening table tag:

MULTIMEDIA TAGS: AUDIO AND VIDEO

In this section I want to show you the audio and video tags.

The audio tag

This tag allows you to embed audio content in your HTML pages.

This element can stream audio, maybe using a microphone via getUserMedia() , or it can play an audio source which you reference using the src attribute:

By default the browser does not show any controls for this element. Which means the audio will play only if set to autoplay (more on this later) and the user can't see how to stop it or control the volume or move through the track.

To show the built-in controls, you can add the controls attribute:

Controls can have a custom skin.

You can specify the MIME type of the audio file using the type attribute. If not set, the browser will try to automatically determine it:

An audio file by default does not play automatically. Add the autoplay attribute to play the audio automatically:

Note: mobile browsers don't allow autoplay

The loop attribute restarts the audio playing at 0:00 if set; otherwise, if not present, the audio stops at the end of the file:

You can also play an audio file muted using the muted attribute (not really sure what's the usefulness of this):

Using JavaScript you can listen for various events happening on an audio element, the most basic of which are:

  • play when the file starts playing
  • pause when the audio playing was paused
  • playing when the audio is resumed from a pause
  • ended when the end of the audio file was reached

The video tag

This tag allows you to embed video content in your HTML pages.

This element can stream video, using a webcam via getUserMedia() or WebRTC , or it can play a video source which you reference using the src attribute:

By default the browser does not show any controls for this element, just the video.

Which means the video will play only if set to autoplay (more on this later) and the user can't see how to stop it, pause it, control the volume or skip to a specific position in the video.

You can specify the MIME type of the video file using the type attribute. If not set, the browser will try to automatically determine it:

A video file by default does not play automatically. Add the autoplay attribute to play the video automatically:

Some browsers also require the muted attribute to autoplay. The video autoplays only if muted:

The loop attribute restarts the video playing at 0:00 if set; otherwise, if not present, the video stops at the end of the file:

You can set an image to be the poster image:

If not present, the browser will display the first frame of the video as soon as it's available.

You can set the width and height attributes to set the space that the element will take so that the browser can account for it and it does not change the layout when it's finally loaded. It takes a numeric value, expressed in pixels.

Using JavaScript you can listen for various events happening on an video element, the most basic of which are:

  • pause when the video was paused
  • playing when the video is resumed from a pause
  • ended when the end of the video file was reached

The iframe tag allows us to embed content coming from other origins (other sites) into our web page.

Technically, an iframe creates a new nested browsing context. This means that anything in the iframe does not interfere with the parent page, and vice versa. JavaScript and CSS do not "leak" to/from iframes.

Many sites use iframes to perform various things. You might be familiar with Codepen, Glitch or other sites that allow you to code in one part of the page, and you see the result in a box. That's an iframe.

You create one this way:

You can load an absolute URL, too:

You can set a set of width and height parameters (or set them using CSS) otherwise the iframe will use the defaults, a 300x150 pixels box:

The srcdoc attribute lets you specify some inline HTML to show. It's an alternative to src , but recent and not supported in Edge 18 and lower, and in IE:

The sandbox attribute allows us to limit the operations allowed in the iframes.

If we omit it, everything is allowed:

If we set it to "", nothing is allowed:

We can select what to allow by adding options in the sandbox attribute. You can allow multiple ones by adding a space in between. Here's an incomplete list of the options you can use:

  • allow-forms : allow to submit forms
  • allow-modals allow to open modals windows, including calling alert() in JavaScript
  • allow-orientation-lock allow to lock the screen orientation
  • allow-popups allow popups, using window.open() and target="_blank" links
  • allow-same-origin treat the resource being loaded as same origin
  • allow-scripts lets the loaded iframe run scripts (but not create popups).
  • allow-top-navigation gives access to the iframe to the top level browsing context

Currently experimental and only supported by Chromium-based browsers, this is the future of resource sharing between the parent window and the iframe.

It's similar to the sandbox attribute, but lets us allow specific features, including:

  • accelerometer gives access to the Sensors API Accelerometer interface
  • ambient-light-sensor gives access to the Sensors API AmbientLightSensor interface
  • autoplay allows to autoplay video and audio files
  • camera allows to access the camera from the getUserMedia API
  • display-capture allows to access the screen content using the getDisplayMedia API
  • fullscreen allows to access fullscreen mode
  • geolocation allows to access the Geolocation API
  • gyroscope gives access to the Sensors API Gyroscope interface
  • magnetometer gives access to the Sensors API Magnetometer interface
  • microphone gives access to the device microphone using the getUserMedia API
  • midi allows access to the Web MIDI API
  • payment gives access to the Payment Request API
  • speaker allows access to playing audio through the device speakers
  • usb gives access to the WebUSB API.
  • vibrate gives access to the Vibration API
  • vr gives access to the WebVR API

When loading an iframe, the browser sends it important information about who is loading it in the Referer header (notice the single r , a typo we must live with).

The misspelling of referrer originated in the original proposal by computer scientist Phillip Hallam-Baker to incorporate the field into the HTTP specification. The misspelling was set in stone by the time of its incorporation into the Request for Comments standards document RFC 1945

The referrerpolicy attribute lets us set the referrer to send to the iframe when loading it. The referrer is an HTTP header that lets the page know who is loading it. These are the allowed values:

  • no-referrer-when-downgrade it's the default, and does not send the referrer when the current page is loaded over HTTPS and the iframe loads on the HTTP protocol
  • no-referrer does not send the referrer header
  • origin the referrer is sent, and only contains the origin (port, protocol, domain), not the origin + path which is the default
  • origin-when-cross-origin when loading from the same origin (port, protocol, domain) in the iframe, the referrer is sent in its complete form (origin + path). Otherwise only the origin is sent
  • same-origin the referrer is sent only when loading from the same origin (port, protocol, domain) in the iframe
  • strict-origin sends the origin as the referrer if the current page is loaded over HTTPS and the iframe also loads on the HTTPS protocol. Sends nothing if the iframe is loaded over HTTP
  • strict-origin-when-cross-origin sends the origin + path as the referrer when working on the same origin. Sends the origin as the referrer if the current page is loaded over HTTPS and the iframe also loads on the HTTPS protocol. Sends nothing if the iframe is loaded over HTTP
  • unsafe-url : sends the origin + path as the referrer even when loading resources from HTTP and the current page is loaded over HTTPS

Images can be displayed using the img tag.

This tag accepts a src attribute, which we use to set the image source:

We can use a wide set of images. The most common ones are PNG, JPEG, GIF, SVG and more recently WebP.

The HTML standard requires an alt attribute to be present, to describe the image. This is used by screen readers and also by search engine bots:

You can set the width and height attributes to set the space that the element will take, so that the browser can account for it and it does not change the layout when it's fully loaded. It takes a numeric value, expressed in pixels.

The figure tag

The figure tag is often used along with the img tag.

figure is a semantic tag often used when you want to display an image with a caption. You use it like this:

The figcaption tag wraps the caption text.

Responsive images using srcset

The srcset attribute allows you to set responsive images that the browser can use depending on the pixel density or window width, according to your preferences. This way, it can only download the resources it needs to render the page, without downloading a bigger image if it's on a mobile device, for example.

Here's an example, where we give 4 additional images for 4 different screen sizes:

In the srcset we use the w measure to indicate the window width.

Since we do so, we also need to use the sizes attribute:

In this example the (max-width: 500px) 100vw, (max-width: 900px) 50vw, 800px string in the sizes attribute describes the size of the image in relation to the viewport, with multiple conditions separated by a semicolon.

The media condition max-width: 500px sets the size of the image in correlation to the viewport width. In short, if the window size is < 500px, it renders the image at 100% of the window size.

If the window size is bigger but < 900px , it renders the image at 50% of the window size.

And if even bigger, it renders the image at 800px.

The vw unit of measure can be new to you, and in short we can say that 1 vw is 1% of the window width, so 100vw is 100% of the window width.

A useful website to generate the srcset and progressively smaller images is https://responsivebreakpoints.com/ .

The picture tag

HTML also gives us the picture tag, which does a very similar job to srcset , and the differences are very subtle.

You use picture when instead of just serving a smaller version of a file, you completely want to change it. Or serve a different image format.

The best use case I found is when serving a WebP image, which is a format still not widely supported. In the picture tag you specify a list of images, and they will be used in order, so in the next example, browsers that support WebP will use the first image, and fallback to JPG if not:

The source tag defines one (or more) formats for the images. The img tag is the fallback in case the browser is very old and does not support the picture tag.

In the source tag inside picture you can add a media attribute to set media queries.

The example that follows kind of works like the above example with srcset :

But that's not its use case, because as you can see it's much more verbose.

The picture tag is recent but is now supported by all the major browsers except Opera Mini and IE (all versions).

ACCESSIBILITY

It's important we design our HTML with accessibility in mind.

Having accessible HTML means that people with disabilities can use the Web. There are totally blind or visually impaired users, people with hearing loss issues and a multitude of other different disabilities.

Unfortunately this topic does not take the importance it needs, and it doesn't seem as cool as others.

What if a person can't see your page, but still wants to consume its content? First, how do they do that? They can't use the mouse, they use something called a screen reader . You don't have to imagine that. You can try one now: Google provides the free ChromeVox Chrome Extension . Accessibility must also take care of allowing tools to easily select elements or navigate through the pages.

Web pages and Web apps are not always built with accessibility as one of their first goals, and maybe version 1 is released not accessible but it's possible to make a web page accessible after the fact. Sooner is better, but it's never too late.

It's important and in my country, websites built by the government or other public organizations must be accessible.

What does this mean to make an HTML accessible? Let me illustrate the main things you need to think about.

Note: there are several other things to take care about, which might go in the CSS topic, like colors, contrast and fonts. Or how to make SVG images accessible . I don't talk about them here.

Use semantic HTML

Semantic HTML is very important and it's one of the main things you need to take care of. Let me illustrate a few common scenarios.

It's important to use the correct structure for heading tags. The most important is h1 , and you use higher numbers for less important ones, but all the same-level headings should have the same meaning (think about it like a tree structure)

Use strong and em instead of b and i . Visually they look the same, but the first 2 have more meaning associated with them. b and i are more visual elements.

Lists are important. A screen reader can detect a list and provide an overview, then let the user choose to get into the list or not.

A table should have a caption tag that describes its content:

Use alt attributes for images

All images must have an alt tag describing the image content. It's not just a good practice, it's required by the HTML standard and your HTML without it is not validated.

It's also good for search engines, if that's an incentive for you to add it.

Use the role attribute

The role attribute lets you assign specific roles to the various elements in your page.

You can assign lots of different roles: complementary, list, listitem, main, navigation, region, tab, alert, application, article, banner, button, cell, checkbox, contentinfo, dialog, document, feed, figure, form, grid, gridcell, heading, img, listbox, row, rowgroup, search, switch, table, tabpanel, textbox, timer.

It's a lot and for the full reference of each of them I give you this MDN link . But you don't need to assign a role to every element in the page. Screen readers can infer from the HTML tag in most cases. For example you don't need to add a role tag to semantic tags like nav , button , form .

Let's take the nav tag example. You can use it to define the page navigation like this:

If you were forced to use a div tag instead of nav , you'd use the navigation role:

So here you got a practical example: role is used to assign a meaningful value when the tag does not convey the meaning already.

Use the tabindex attribute

The tabindex attribute allows you to change the order of how pressing the Tab key selects "selectable" elements. By defaults only links and form elements are "selectable" by navigation using the Tab key (and you don't need to set tabindex on them).

Adding tabindex="0" makes an element selectable:

Using tabindex="-1" instead removes an element from this tab-based navigation, and it can be pretty useful.

Use the aria attributes

ARIA is an acronym that means Accessible Rich Internet Applications and defines semantics that can be applied to elements.

This attribute is used to add a string to describe an element.

I use this attribute on my blog sidebar, where I have an input box for search without an explicit label, as it has a placeholder attribute.

aria-labelledby

This attribute sets a correlation between the current element and the one that labels it.

If you know how an input element can be associated to a label element, that's similar.

We pass the item id that describes the current element.

aria-describedby

This attribute lets us associate an element with another element that serves as description.

Use aria-hidden to hide content

I like a minimalistic design in my sites. My blog for example is mostly just content, with some links in the sidebar. But some things in the sidebar are just visual elements that don't add up to the experience of a person that can't see the page. Like my logo picture, or the dark/bright theme selector.

Adding the aria-hidden="true" attribute will tell screen readers to ignore that element.

Where to learn more

This is just an introduction to the topic. To learn more, I recommend these resources:

  • https://www.w3.org/TR/WCAG20/
  • https://webaim.org
  • https://developers.google.com/web/fundamentals/accessibility/

You reached the end of the HTML Handbook.

1563876708

Click here to get a PDF / ePub / Mobi version of this book to read offline !

Read more posts .

If this article was helpful, share it .

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

To log in and use all the features of Khan Academy, please enable JavaScript in your browser.

Unit 2: Intro to HTML/CSS: Making webpages

About this unit.

Learn how to use HTML and CSS to make webpages. HTML is the markup language that you surround content with, to tell browsers about headings, lists, tables, and more. CSS is the stylesheet language that you style the page with, to tell browsers to change the color, font, layout, and more.

Intro to HTML

  • Welcome to the web! (Opens a modal)
  • HTML basics (Opens a modal)
  • Quick tip: HTML tags (Opens a modal)
  • Challenge: Write a Poem (Opens a modal)
  • HTML: Text emphasis (Opens a modal)
  • Challenge: You can learn text tags (Opens a modal)
  • HTML: Lists (Opens a modal)
  • Challenge: Wishlist (Opens a modal)
  • HTML: Images (Opens a modal)
  • Challenge: A picture-perfect trip (Opens a modal)

Intro to CSS

  • CSS Basics (Opens a modal)
  • Quick tip: Selecting by tag name (Opens a modal)
  • Challenge: Colorful creature (Opens a modal)
  • CSS: Selecting by id (Opens a modal)
  • Challenge: Seasonal ids (Opens a modal)
  • CSS: Selecting by class (Opens a modal)
  • Challenge: Apples and bananas classes (Opens a modal)
  • Project: Travel webpage (Opens a modal)
  • Using simple CSS selectors 4 questions Practice

More HTML tags

  • HTML links (Opens a modal)
  • Challenge: Links for learning (Opens a modal)
  • HTML internal links (Opens a modal)
  • Challenge: Jump around (Opens a modal)
  • HTML tables (Opens a modal)
  • Challenge: The dinner table (Opens a modal)
  • HTML comments (Opens a modal)
  • Project: Recipe book (Opens a modal)

CSS text properties

  • CSS Zen Garden (Opens a modal)
  • CSS font-family property (Opens a modal)
  • Challenge: Fancy font families (Opens a modal)
  • CSS font-size property (Opens a modal)
  • Challenge: Great big font sizes (Opens a modal)
  • CSS font styles and shorthand (Opens a modal)
  • Challenge: Famous font formats (Opens a modal)
  • More CSS text properties (Opens a modal)
  • CSS inheritance (Opens a modal)
  • Project: Blog (Opens a modal)
  • Using CSS text properties 4 questions Practice

Web development tools

  • Using the browser developer tools (Opens a modal)
  • Developing webpages outside of Khan Academy (Opens a modal)
  • Hosting your website on a server (Opens a modal)
  • Hosting your website on Github (Opens a modal)
  • CSS grouping elements (Opens a modal)
  • Challenge: Group the groupers (Opens a modal)
  • CSS width, height, and overflow (Opens a modal)
  • Challenge: The overflowing ocean (Opens a modal)
  • CSS box model (Opens a modal)
  • Challenge: The boxer model (Opens a modal)
  • CSS position (Opens a modal)
  • Challenge: Position planet (Opens a modal)
  • CSS in the wild: Google Maps (Opens a modal)
  • CSS floating elements (Opens a modal)
  • Challenge: Floating clouds (Opens a modal)
  • Planning your webpage (Opens a modal)
  • Project: Event invite (Opens a modal)
  • Using CSS layout properties 5 questions Practice

More CSS selectors

  • Using multiple CSS classes (Opens a modal)
  • Challenge: A classy gallery (Opens a modal)
  • Combining CSS class and element selectors (Opens a modal)
  • Challenge: Classes of elements (Opens a modal)
  • CSS descendant selectors (Opens a modal)
  • Challenge: Descendants of Khan (Opens a modal)
  • Grouping CSS selectors (Opens a modal)
  • CSS dynamic pseudo-classes (Opens a modal)
  • Challenge: Grouped animals (Opens a modal)
  • CSS specificity (Opens a modal)
  • CSS specificity rules 4 questions Practice

Other ways to embed CSS

  • Using inline CSS styles (Opens a modal)
  • Using external stylesheets (Opens a modal)

Further learning

  • Webpage design (Opens a modal)
  • HTML validation (Opens a modal)
  • What to learn next (Opens a modal)
  • Validating HTML 4 questions Practice
  • Skip to main content
  • Skip to search
  • Skip to select language
  • Sign up for free
  • Português (do Brasil)

Document and website structure

  • Overview: Introduction to HTML

In addition to defining individual parts of your page (such as "a paragraph" or "an image"), HTML also boasts a number of block level elements used to define areas of your website (such as "the header", "the navigation menu", "the main content column"). This article looks into how to plan a basic website structure, and write the HTML to represent this structure.

Basic sections of a document

Webpages can and will look pretty different from one another, but they all tend to share similar standard components, unless the page is displaying a fullscreen video or game, is part of some kind of art project, or is just badly structured:

Usually a big strip across the top with a big heading, logo, and perhaps a tagline. This usually stays the same from one webpage to another.

Links to the site's main sections; usually represented by menu buttons, links, or tabs. Like the header, this content usually remains consistent from one webpage to another — having inconsistent navigation on your website will just lead to confused, frustrated users. Many web designers consider the navigation bar to be part of the header rather than an individual component, but that's not a requirement; in fact, some also argue that having the two separate is better for accessibility , as screen readers can read the two features better if they are separate.

A big area in the center that contains most of the unique content of a given webpage, for example, the video you want to watch, or the main story you're reading, or the map you want to view, or the news headlines, etc. This is the one part of the website that definitely will vary from page to page!

Some peripheral info, links, quotes, ads, etc. Usually, this is contextual to what is contained in the main content (for example on a news article page, the sidebar might contain the author's bio, or links to related articles) but there are also cases where you'll find some recurring elements like a secondary navigation system.

A strip across the bottom of the page that generally contains fine print, copyright notices, or contact info. It's a place to put common information (like the header) but usually, that information is not critical or secondary to the website itself. The footer is also sometimes used for SEO purposes, by providing links for quick access to popular content.

A "typical website" could be structured something like this:

a simple website structure example featuring a main heading, navigation menu, main content, side bar, and footer.

Note: The image above illustrates the main sections of a document, which you can define with HTML. However, the appearance of the page shown here - including the layout, colors, and fonts - is achieved by applying CSS to the HTML.

In this module we're not teaching CSS, but once you have an understanding of the basics of HTML, try diving into our CSS first steps module to start learning how to style your site.

HTML for structuring content

The simple example shown above isn't pretty, but it is perfectly fine for illustrating a typical website layout example. Some websites have more columns, some are a lot more complex, but you get the idea. With the right CSS, you could use pretty much any elements to wrap around the different sections and get it looking how you wanted, but as discussed before, we need to respect semantics and use the right element for the right job .

This is because visuals don't tell the whole story. We use color and font size to draw sighted users' attention to the most useful parts of the content, like the navigation menu and related links, but what about visually impaired people for example, who might not find concepts like "pink" and "large font" very useful?

Note: Roughly 8% of men and 0.5% of women are colorblind; or, to put it another way, approximately 1 in every 12 men and 1 in every 200 women. Blind and visually impaired people represent roughly 4-5% of the world population (in 2015 there were 940 million people with some degree of vision loss , while the total population was around 7.5 billion ).

In your HTML code, you can mark up sections of content based on their functionality — you can use elements that represent the sections of content described above unambiguously, and assistive technologies like screen readers can recognize those elements and help with tasks like "find the main navigation", or "find the main content." As we mentioned earlier in the course, there are a number of consequences of not using the right element structure and semantics for the right job .

To implement such semantic mark up, HTML provides dedicated tags that you can use to represent such sections, for example:

  • header: <header> .
  • navigation bar: <nav> .
  • main content: <main> , with various content subsections represented by <article> , <section> , and <div> elements.
  • sidebar: <aside> ; often placed inside <main> .
  • footer: <footer> .

Active learning: exploring the code for our example

Our example seen above is represented by the following code (you can also find the example in our GitHub repository ). We'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual.

Take some time to look over the code and understand it — the comments inside the code should also help you to understand it. We aren't asking you to do much else in this article, because the key to understanding document layout is writing a sound HTML structure, and then laying it out with CSS. We'll wait for this until you start to study CSS layout as part of the CSS topic.

HTML layout elements in more detail

It's good to understand the overall meaning of all the HTML sectioning elements in detail — this is something you'll work on gradually as you start to get more experience with web development. You can find a lot of detail by reading our HTML element reference . For now, these are the main definitions that you should try to understand:

  • <main> is for content unique to this page. Use <main> only once per page, and put it directly inside <body> . Ideally this shouldn't be nested within other elements.
  • <article> encloses a block of related content that makes sense on its own without the rest of the page (e.g., a single blog post).
  • <section> is similar to <article> , but it is more for grouping together a single part of the page that constitutes one single piece of functionality (e.g., a mini map, or a set of article headlines and summaries), or a theme. It's considered best practice to begin each section with a heading ; also note that you can break <article> s up into different <section> s, or <section> s up into different <article> s, depending on the context.
  • <aside> contains content that is not directly related to the main content but can provide additional information indirectly related to it (glossary entries, author biography, related links, etc.).
  • <header> represents a group of introductory content. If it is a child of <body> it defines the global header of a webpage, but if it's a child of an <article> or <section> it defines a specific header for that section (try not to confuse this with titles and headings ).
  • <nav> contains the main navigation functionality for the page. Secondary links, etc., would not go in the navigation.
  • <footer> represents a group of end content for a page.

Each of the aforementioned elements can be clicked on to read the corresponding article in the "HTML element reference" section, providing more detail about each one.

Non-semantic wrappers

Sometimes you'll come across a situation where you can't find an ideal semantic element to group some items together or wrap some content. Sometimes you might want to just group a set of elements together to affect them all as a single entity with some CSS or JavaScript . For cases like these, HTML provides the <div> and <span> elements. You should use these preferably with a suitable class attribute, to provide some kind of label for them so they can be easily targeted.

<span> is an inline non-semantic element, which you should only use if you can't think of a better semantic text element to wrap your content, or don't want to add any specific meaning. For example:

In this case, the editor's note is supposed to merely provide extra direction for the director of the play; it is not supposed to have extra semantic meaning. For sighted users, CSS would perhaps be used to distance the note slightly from the main text.

<div> is a block level non-semantic element, which you should only use if you can't think of a better semantic block element to use, or don't want to add any specific meaning. For example, imagine a shopping cart widget that you could choose to pull up at any point during your time on an e-commerce site:

This isn't really an <aside> , as it doesn't necessarily relate to the main content of the page (you want it viewable from anywhere). It doesn't even particularly warrant using a <section> , as it isn't part of the main content of the page. So a <div> is fine in this case. We've included a heading as a signpost to aid screen reader users in finding it.

Warning: Divs are so convenient to use that it's easy to use them too much. As they carry no semantic value, they just clutter your HTML code. Take care to use them only when there is no better semantic solution and try to reduce their usage to the minimum otherwise you'll have a hard time updating and maintaining your documents.

Line breaks and horizontal rules

Two elements that you'll use occasionally and will want to know about are <br> and <hr> .

<br>: the line break element

<br> creates a line break in a paragraph; it is the only way to force a rigid structure in a situation where you want a series of fixed short lines, such as in a postal address or a poem. For example:

Without the <br> elements, the paragraph would just be rendered in one long line (as we said earlier in the course, HTML ignores most whitespace ); with <br> elements in the code, the markup renders like this:

<hr>: the thematic break element

<hr> elements create a horizontal rule in the document that denotes a thematic change in the text (such as a change in topic or scene). Visually it just looks like a horizontal line. As an example:

Would render like this:

Planning a simple website

Once you've planned out the structure of a simple webpage, the next logical step is to try to work out what content you want to put on a whole website, what pages you need, and how they should be arranged and link to one another for the best possible user experience. This is called Information architecture . In a large, complex website, a lot of planning can go into this process, but for a simple website of a few pages, this can be fairly simple, and fun!

the common features of the travel site to go on every page: title and logo, contact, copyright, terms and conditions, language chooser, accessibility policy

Active learning: create your own sitemap

Try carrying out the above exercise for a website of your own creation. What would you like to make a site about?

Note: Save your work somewhere; you might need it later on.

At this point, you should have a better idea about how to structure a web page/site. In the next article of this module, we'll learn how to debug HTML .

Popular Tutorials

Learn python interactively, popular examples.

HTML (HyperText Markup Language) is a language used for creating webpages which is the fundamental building block of the Web.

One thing to remember about HTML is that it is a markup language with no programming constructs. Instead, the language provides us with a structure to build web pages.

Using HTML, we can define web page elements such as paragraphs, headings, links, and images. Our HTML tutorials will teach you everything you need to know about HTML5 (modern HTML) step-by-step.

  • Introduction

HTML Basics

  • Inline Elements
  • Head Elements

Semantic HTML

  • HTML, CSS & JS
  • Graphics & Media
  • Why learn HTML?

How to learn HTML?

Html introduction.

  • What is HTML?
  • Web Design Basics
  • HTML Paragraphs
  • HTML Headings
  • HTML Comments
  • HTML Unordered List
  • HTML Ordered List
  • HTML Description List
  • HTML Line Break
  • HTML Pre Tag
  • HTML Horizontal Line

HTML Inline

  • HTML Block and Inline Elements
  • HTML Images
  • HTML Italic
  • HTML Superscript and Subscript
  • HTML Formatting
  • HTML Meta Elements
  • HTML Favicon
  • HTML Form Elements
  • HTML Form Action
  • HTML Semantic HTML
  • HTML div Tag
  • HTML aside Tag
  • HTML section Tag
  • HTML footer Tag
  • HTML main Tag
  • HTML figure and figcaption
  • HTML Accessibility

HTML, CSS & JavaScript

  • HTML Layout
  • HTML Responsive Web Design
  • HTML and JavaScript

HTML Graphics & Media

  • HTML Canvas

HTML Miscellaneous

  • HTML Iframes
  • HTML Entities
  • HTML Quotations
  • HTML File Paths
  • HTML Emojis
  • HTML Symbols
  • HTML is the standard markup language for creating the structure of web pages.
  • We can display web page content like paragraphs, lists, images, and links in a structured way using HTML.
  • We can only define the structure of a website using HTML. For appearance (color, layout, design), we use CSS. Similarly, JavaScript is used for adding functionality to a web page.
  • HTML5 is the latest and major HTML version.

Why Learn HTML?

  • HTML is the backbone of all websites; we can use it to create the structure and layout of a webpage. In addition, HTML will allow you to design your own websites and edit existing ones.
  • It is a fundamental skill for web development and often a necessary step before learning other languages like CSS and JavaScript. Plus, it's a well-established language with tons of resources available for learning and troubleshooting.
  • With HTML, you can better optimize your website's SEO and improve your marketing.
  • HTML is easy to learn and use, making it a perfect choice for beginners.
  • If you're looking for career opportunities, HTML can open doors in web development, web design, front-end development, and user experience design.
  • Programiz HTML Tutorials - Learn everything you need to know about HTML5 step-by-step.
  • Mozilla Documentation - Learn modern HTML in-depth (can be a little hard to follow).
  • FreeCodeCamp HTML Course - Learn HTML interactively for FREE.

32 HTML And CSS Projects For Beginners (With Source Code)

html website assignment

updated Apr 17, 2024

If you want to feel confident in your front-end web developer skills, the easiest solution is to start building your own HTML and CSS projects from scratch.

As with any other skill, practicing on simple, realistic projects helps you build your skills and confidence step-by-step.

But if you are new to HTML and CSS, you may be wondering:

Where can I find ideas for beginner-level HTML and CSS projects?

Even if you are just starting out with HTML and CSS, there are some fun and easy projects you can create.

Whether you are new to learning web development or have some experience under your belt, this guide is the perfect place to start improving your skills.

In this article, I’ll walk you through 32 fun HTML and CSS coding projects that are easy to follow. We will start with beginner-level projects and then move on to more demanding ones.

If you want to become a professional front-end developer, the projects below will help you expand your portfolio.

When it’s time to apply for your first entry-level job, you can showcase your skills to potential employers with a portfolio packed with real-life project examples.

Let’s get started!

Please note: This post contains affiliate links to products I use and recommend. I may receive a small commission if you purchase through one of my links, at no additional cost to you. Thank you for your support!

What are HTML and CSS?

HTML and CSS are the most fundamental languages for front-end web development.

Learning them will allow you to:

  • Build stunning websites
  • Start a coding blog
  • Make money freelancing

Let’s take a quick look at both of them next:

What is HTML?

HTML or HyperText Markup Language is the standard markup language for all web pages worldwide.

It’s not a “typical” programming language – like Python or Java – since it doesn’t contain any programming logic. HTML can’t perform data manipulations or calculations, for example.

Instead, HTML allows you to create and format the fundamental structure and content of a web page.

You will use HTML to create:

  • Page layouts (header, body, footer, sidebar)
  • Paragraphs and headings
  • Input fields
  • Checkboxes and radio buttons
  • Embedded media

Thus, HTML only allows you to determine the structure of a web page and place individual content elements within it.

For more details, check out my post on what HTML is and how it works .

You can’t format the look and feel of your web page with HTML, though.

Your HTML web page will look dull and boring. Sort of like this:

The first HTML WWW website ever built

The example above is the first web page every built for the WWW , by the way.

This is how websites used to look in the ’90s. But we’ve come a long way since then – luckily.

To make your HTML content visually appealing and professional-looking, you need another language: CSS. Let’s look at that next.

What is CSS?

CSS or Cascading Style Sheets is a style sheet language that allows you to adjust the design and feel of your HTML content.

Thus, you can turn your pure-HTML pages into stunning, modern websites with CSS. And it’s super easy to learn, too!

Here’s how it works:

CSS allows you to target individual HTML elements and apply different styling rules to them.

For example, here’s a CSS rule that targets H2 headings, their font-size property, and sets it to a value of 24px:

You can use CSS to adjust:

  • Backgrounds
  • Fonts and text styling
  • Spacings (paddings, margins)
  • CSS animations
  • Responsiveness (media queries)

If you want to create stunning websites and become a front-end web developer, CSS is one of the first tools you must learn and master.

For more details, check out my post on what CSS is and how it works .

learning to code working on laptop

Why build HTML and CSS projects?

Practicing on realistic, hands-on projects is the best way to learn how to create something useful and meaningful with HTML and CSS.

The more projects you build, the more confident you will feel in your skills.

To build a web page from scratch , you need a basic understanding of how HTML works. You should be comfortable with writing the necessary HTML code to create a page without copying a boilerplate or following a tutorial.

Thus, if you want to become a front-end web developer , building HTML and CSS projects will teach you how to use these two languages in real life.

Therefore, practising your skills with the projects in this article will give you a competitive edge against anyone who’s simply following tutorials and copy-pasting other people’s code.

Finally, building HTML and CSS projects helps you build a professional portfolio of real-world projects.

When it’s time to start applying for your first job, you will have 10 to 20 cool projects to showcase your skills to potential employers. Not bad!

32 HTML and CSS projects: Table of contents

Here’s an overview of the HTML and CSS projects we’ll go through:

Beginner project: CSS radio buttons

Beginner project: css toggle buttons, beginner project: hamburger menu, beginner project: pure css sidebar toggle menu, beginner project: animated css menu, beginner project: custom checkboxes, beginner project: pure css select dropdown, beginner project: modal/popup without javascript, beginner project: animated gradient ghost button, beginner project: css image slider, basic html & css website layout, tribute page, survey page with html forms, sign-up page / log-in page, job application form page, landing page, product landing page, interactive navigation bar, responsive website header, restaurant menu, restaurant website, parallax website, custom 404 error page, personal portfolio website, blog post layout.

  • Photography website

Music store website

Discussion forum website.

  • Event or conference website

Technical documentation website

Online recipe book, website clone.

Share this post with others!

HTML and CSS projects for beginners with source code – Mikke Goes Coding

This quick project is a great example of what you can do with pure CSS to style radio buttons or checkboxes:

See the Pen CSS radio buttons by Angela Velasquez ( @AngelaVelasquez ) on CodePen .

☝️ back to top ☝️

This HTML and CSS project teaches you how to create custom CSS toggle buttons from scratch:

See the Pen Pure CSS Toggle Buttons | ON-OFF Switches by Himalaya Singh ( @himalayasingh ) on CodePen .

Every website needs a menu, right?

This hamburger menu is beautiful and clean, and you can build it with just HTML and CSS:

See the Pen Pure CSS Hamburger fold-out menu by Erik Terwan ( @erikterwan ) on CodePen .

Placing your website navigation inside a sidebar toggle is an easy way to clean up the overall look and feel of your design.

Here’s a modern-looking solution to a pure-CSS sidebar toggle menu:

See the Pen PURE CSS SIDEBAR TOGGLE MENU by Jelena Jovanovic ( @plavookac ) on CodePen .

If you want to build a more dynamic, interactive website navigation, try this animated CSS menu:

See the Pen Animate menu CSS by Joël Lesenne ( @joellesenne ) on CodePen .

Styling your checkboxes to match the overall design is an easy way to elevate the look and feel of your website.

Here’s an easy HTML and CSS practice project to achieve that:

See the Pen Pure CSS custom checkboxes by Glen Cheney ( @Vestride ) on CodePen .

Standard select dropdowns often look dull and boring. Here’s a quick CSS project to learn how to create beautiful select dropdowns easily:

See the Pen Pure CSS Select by Raúl Barrera ( @raubaca ) on CodePen .

Modals and popups often use JavaScript, but here’s a pure HTML and CSS solution to creating dynamic, interactive modals and popups:

See the Pen Pure css popup box by Prakash ( @imprakash ) on CodePen .

Ghost buttons can look great if they fit the overall look and feel of your website.

Here’s an easy project to practice creating stunning, dynamic ghost buttons for your next website project:

See the Pen Animated Gradient Ghost Button Concept by Arsen Zbidniakov ( @ARS ) on CodePen .

This image slider with navigation buttons and dots is a fantastic HTML and CSS project to practice your front-end web development skills:

See the Pen CSS image slider w/ next/prev btns & nav dots by Avi Kohn ( @AMKohn ) on CodePen .

Now, before you start building full-scale web pages with HTML and CSS, you want to set up your basic HTML and CSS website layout first.

The idea is to divide your page into logical HTML sections. That way, you can start filling those sections with the right elements and content faster.

For example, you can break up the body of your page into multiple parts:

  • Header: <header>
  • Navigation: <nav>
  • Content: <article>
  • Sidebar: <aside>
  • Footer: <footer>

HTML web page structure example

Depending on your project, you can fill the article area with a blog post, photos, or other content you need to present.

This layout project will serve as a starting point for all your future HTML and CSS projects, so don’t skip it.

Having a template like this will speed up your next projects, because you won’t have to start from scratch.

Here are two tutorials that will walk you through the steps of creating a basic website layout using HTML and CSS:

  • https://www.w3schools.com/html/html_layout.asp
  • https://www.w3schools.com/css/css_website_layout.asp

Building a tribute page is fantastic HTML and CSS practice for beginners.

What should your tribute page be about?

Anything you like!

Build a tribute page about something you love spending time with.

Here are a few examples:

  • a person you like
  • your favorite food
  • a travel destination
  • your home town

My first HTML-only tribute page was for beetroots. Yes, beetroots. I mean, why not?

Beetroot Base HTML Page

HTML and CSS concepts you will practice:

  • HTML page structure
  • basic HTML elements: headings, paragraphs, lists
  • embedding images with HTML
  • CSS fundamentals: fonts and colors
  • CSS paddings, margins, and borders

Here’s a helpful tutorial for building a HTML and CSS tribute page .

Whether you want to become a full-time web developer or a freelance web designer, you will use HTML forms in almost every project.

Forms allow you to build:

  • Contact forms
  • Login forms
  • Sign up forms
  • Survey forms

Building a survey page allows you to practice HTML input tags, form layouts, radio buttons, checkboxes, and more.

Pick any topic you like and come up with 10 pieces of information you want to collect from respondents.

Perhaps an employee evaluation form? Or a customer satisfaction form?

  • form elements: input fields, dropdowns, radio buttons, labels
  • styling for forms and buttons

Here’s an example survey form project for inspiration:

See the Pen Good Vibes Form by Laurence ( @laurencenairne ) on CodePen .

Let’s practice those HTML forms a bit more, shall we?

For this project, you will build a sign-up or log-in page with the necessary input fields for a username and a password.

Because we can create a user profile on almost every website, forms are absolutely essential for allowing people to set their usernames and passwords.

Your forms will collect inputs from users and a separate back-end program will know how to store and process that data.

Creating a clean and clear sign-up page can be surprisingly difficult. The more you learn about HTML and CSS, the more content you want to create to showcase your skills. But the thing is: a sign-up page needs to be as clean and easy-to-use as possible.

Thus, the biggest challenge with this project is to keep it simple, clear, and light.

Here’s an example project to get started with:

See the Pen Learn HTML Forms by Building a Registration Form by Noel ( @WaterNic10 ) on CodePen .

For more inspiration, check out these 50+ sign-up forms built with HTML and CSS .

Using a HTML form is the best way to collect information from job applicants.

You can also generate and format a job description at the top of the page.

Then, create a simple job application form below to collect at least 10 pieces of information.

Use these HTML elements, for example:

  • Text fields
  • Email fields
  • Radio buttons

Here’s an example job application page you can build with HTML and CSS:

See the Pen Simple Job Application Form Example by Getform ( @getform ) on CodePen .

One of your first HTML and CSS projects should be a simple landing page.

Your landing page can focus on a local business, an event, or a product launch, for example.

Landing pages play an important role for new businesses, marketing campaigns, and product launches. As a front-end developer, you will be asked to create them for clients.

For this project, create a simple HTML file and style it with CSS. Be sure to include a headline, some text about the company or its services, and a call-to-action (CTA) button.

Make sure that your landing page is clean and clear and that it’s easy to read.

If you build a landing page for a new product, highlight the product’s key benefits and features.

To get started, follow this freeCodeCamp tutorial to build a simple landing page . You will need JavaScript for a few features. If you are not familiar with JavaScript, leave those features out for now and come back to them later.

For more inspiration, check out these HTML landing page templates .

Switch landing page template – HTML and CSS projects for beginners

A product landing page is a page that you build to promote a specific product or service.

For example, if you want to sell your ebook about how to use CSS to build an animated website, then you would create a product landing page for it.

Your product landing page can be very simple to start with. When your skills improve, add some complexity depending on what kind of information you need to present.

One of the most iconic product landing pages is the iPhone product page by Apple, for example:

Apple iPhone product landing page example

Of course, the iPhone landing page is technically complex, so you won’t build it as your first project. But still, it’s a good place to find inspiration and new ideas.

The best way to design your first product landing page is to create a simple wireframe first. Sketch your page layout on paper before you start building it.

Wireframes help you maintain a clear overview of your HTML sections and elements.

To get started, browse through these product landing page examples for some inspiration .

Building an interactive navigation bar will teach you how to create an animated menu with dropdowns using HTML and CSS.

This is another great project for beginners, because it will teach you how to create menus using HTML and CSS. You’ll also learn how to style them with different colors, fonts, and effects.

You’ll also learn how to use anchors and pseudo-classes to create the menu navigation, as well as how to create the dropdown menus from scratch.

If you aren’t familiar with CSS media queries yet, building a responsive navigation bar is a smart way to learn and practice them.

CSS media queries allow you to create a responsive navigation menu that changes its size and layout depending on screen width.

To get started, check out this tutorial on how to build an interactive navigation bar with HTML and CSS .

One of the best ways to practice your HTML and CSS skills is to create custom website headers. This is a great project to add to your portfolio website, as it will show off your skills and help you attract new clients.

There are a number of different ways that you can create a stylish and responsive website header. One option is to use a premade CSS framework such as Bootstrap or Foundation. Alternatively, you can create your own custom styles by hand.

No matter which option you choose, be sure to make your header mobile-friendly by using media queries. This will ensure that your header looks great on all devices, regardless of their screen size or resolution.

To get started, check out this simple example for a responsive HTML and CSS header .

If you’re looking to get into web development, one of the best HTML and CSS projects you can build is a simple restaurant menu.

Align the different foods and drinks using a CSS layout grid.

Add prices, images, and other elements you need to give it a professional, clean look and feel.

Choose a suitable color palette, fonts, and stock photos.

You can also add photos or a gallery for individual dishes. If you want to add an image slider, you can create one with HTML and CSS, too.

Here’s an example of a very simple restaurant menu project:

See the Pen Simple CSS restaurant menu by Viszked Tamas Andras ( @ViszkY ) on CodePen .

Once you’ve built your restaurant menu with, it’s time to tackle a more complex HTML and CSS project.

Building a real-life restaurant website is a fun way to practice a ton of HTML and CSS topics.

Not only will you learn the basics of creating a beautiful, professional web page, but you also get a chance to practice responsive web design, too.

And if you’re looking to land your first front-end web developer job, having a well-designed business website in your portfolio will help you stand out from the crowd.

Restaurant website example project with HTML and CSS

Make sure your website matches the restaurant’s menu and target clientele. A fine-dining place on Manhattan will have a different website than a simple (but delicious!) diner in rural Wisconsin.

Here are a few key details to include on your restaurant website:

  • Clear navigation bar
  • Restaurant details
  • Menu for food and drinks
  • Location and directions
  • Contact details
  • Upcoming events

To get started, check out this free tutorial on how to build a restaurant website with HTML and CSS .

To build a parallax website, you will include fixed background images that stay in place when you scroll down the page.

Although the parallax look isn’t as popular or modern as it was a few years back, web designers still use the effect a lot.

The easiest way to build a parallax HTML and CSS project is to start with a fixed background image for the entire page.

After that, you can experiment with parallax effects for individual sections.

Create 3-5 sections for your page, fill them with content, and set a fixed background image for 1-2 sections of your choice.

Word of warning: Don’t overdo it. Parallax effects can be distracting, so only use them as a subtle accent where suitable.

Here’s an example project with HTML and CSS source code:

See the Pen CSS-Only Parallax Effect by Yago Estévez ( @yagoestevez ) on CodePen .

404 error pages are usually boring and generic, right?

But when a visitor can’t find what they’re searching for, you don’t want them to leave your website.

Instead, you should build a custom 404 error page that’s helpful and valuable, and even fun and entertaining.

A great 404 page can make users smile and – more importantly – help them find what they are looking for. Your visitors will appreciate your effort, trust me.

For some inspiration, check out these custom 404 page examples .

Any web developer will tell you that having a strong portfolio is essential to landing your first job.

Your portfolio is a chance to show off your skills and demonstrate your expertise in front-end web development.

And while there are many ways to create a portfolio website, building one from scratch using HTML and CSS will give you tons of valuable practice.

Your first version can be a single-page portfolio. As your skills improve, continue adding new pages, content, and features. Make this your pet project!

Remember to let your personality shine through, too. It will help you stand out from the crowd of other developers who are vying for the same jobs.

Introduce yourself and share a few details about your experience and future plans.

Employers and clients want to see how you can help them solve problems. Thus, present your services and emphasize the solutions you can deliver with your skills.

Add your CV and share a link to your GitHub account to showcase your most relevant work samples.

Make sure to embed a few key projects directly on your portfolio website, too.

Finally, let your visitors know how to get in touch with you easily. If you want, you can add links to your social media accounts, too.

In this project, you’ll create a simple blog post page using HTML and CSS.

You’ll need to design the layout of the page, add a title, a featured image, and of course add some content to your dummy blog post.

You can also add a sidebar with a few helpful links and widgets, like:

  • An author bio with a photo
  • Links to social media profiles
  • List of most recent blog posts
  • List of blog post categories

Once your HTML structure and content are in place, it’s time to style everything with CSS.

Photography website with a gallery

If you’re a photographer or just enjoy taking pictures, then this project is for you.

Build a simple photo gallery website using HTML and CSS to practice your web design skills.

Start with the basic HTML structure of the page, and figure out a cool layout grid for the photos. You will need to embed the photos and style everything beautiful with CSS.

My tip: Use CSS Flexbox and media queries to create a responsive galleries that look great on all devices.

Here’s a full tutorial for building a gallery website with HTML and CSS:

If you love music, why not practice your HTML and CSS skills by building a music store web page?

Before you start, make a thorough plan about your website structure. What’s the purpose of your music store? What genres will you cover?

Pick a suitable color palette, choose your fonts, and any background images you want to use.

My tip: If you feature album cover images, keep your colors and fonts as clean and simple as possible. You don’t want to overpower the album covers with a busy web page with tons of different colors and mismatching fonts.

Create a user-friendly menu and navigation inside the header. Fill the footer with helpful links for your store, career page, contact details, and newsletter form, for example.

Building a music store website with HTML and CSS is a great opportunity to practice your skills while you are still learning.

Start with very basic features, and add new ones as your skills improve. For example, you can add media queries to make your website responsive.

A forum is a great way to create a community around a topic or interest, and it’s also a great way to practice your coding skills.

In this project, you’ll create a simple forum website using HTML and CSS.

You’ll need to design the layout of the site, add categories and forums, and set up some initial content.

Of course, you should start with creating the basic layout and structure with HTML first. You will need a navigation bar, at least one sidebar, and an area for the main content.

To make your discussion forum website more interesting, add new content and remember to interlink related threads to make the site feel more realistic.

Event or conference web page

Creating a web page for an event is a fun HTML and CSS project for beginners.

You can either pick a real event and build a better landing page than the real one, or come up with an imaginary conference, for example.

Make sure to include these elements:

  • Register button
  • Venue details
  • Dates and schedule
  • Speakers and key people
  • Directions (how to get there)
  • Accommodation details

Divide the landing page into sections, and create a header and a footer with menus and quick links.

Come up with a suitable color palette, pick your fonts, and keep your design clean and clear.

Every programming language, software, device and gadget has a technical documentation for helpful information and support.

Creating a technical documentation website with just HTML and CSS allows you to build a multi-page site with hierarchies, links, and breadcrumbs.

The main idea is to create a multi-page website where you have a sidebar menu on the left, and the content on the right.

The left-hand side contains a vertical menu with all the topics your documentation covers.

The right-hand side presents the description and all the details for each individual topic.

For simplicity, start with the homepage and 2–3 subpages first. Come up with a clean layout and make sure your links are working properly.

Then, start expanding the website with additional sub-pages, content, and elements.

  • HTML hyperlinks and buttons

Creating an online recipe book as an HTML and CSS project requires a similar setup than the previous project example.

You will need to create a homepage that serves as a directory for all your recipes. Then, create a separate subpage for each recipe.

If you want to challenge yourself, add recipe categories and create separate directory pages for each of them.

  • embedding recipe photos

One of the best ways to practice HTML and CSS is to clone an existing web page from scratch.

Use your browser’s inspecting tools to get an idea of how the page is built.

As with any HTML and CSS project, start by creating the basic page template with:

Then, divide your page into sections, rows, and columns.

Finally, fill your page with individual elements like headings, paragraphs, and images.

Once the HTML content is in place, use CSS to style your page.

Start with something simple, like the PayPal login page.

Then move on to more demanding cloning projects, such as a news website. Try the BBC homepage, for example.

Where to learn HTML and CSS?

There are no prerequisites required for you to learn HTML and CSS.

Both languages are easy to learn for beginners, and you can start building real-life projects almost right away.

Here are a few courses to check out if you want to learn HTML and CSS online at your own pace:

1: Build Responsive Real World Websites with HTML5 and CSS3

Build Responsive Real-World Websites with HTML and CSS – Udemy

Build Responsive Real World Websites with HTML5 and CSS3 was my first online web development course focused 100% on HTML and CSS.

You don’t need any coding or web development experience for this course. But if you have watched some online tutorials but you’re not sure how to create a full-scale website by yourself, you are going to love it.

2: The Complete Web Developer Course 2.0

The Complete Web Developer Course 2.0 – Udemy

The Complete Web Developer Course 2.0 changed my life back when I started learning web development.

This course takes you from zero to knowing the basics of all fundamental, popular web development tools. You’ll learn:

  • HTML and CSS
  • JavaScript and jQuery
  • and much more

3: Modern HTML & CSS From The Beginning (Including Sass)

Modern HTML & CSS From The Beginning (Including Sass) – Udemy

I’m a big fan of Brad Traversy, and I really can’t recommend his Modern HTML & CSS From The Beginning course enough.

Even if you have never built a website with HTML and CSS before, this course will teach you all the basics you need to know.

4: The Complete 2023 Web Development Bootcamp

The Complete 2023 Web Development Bootcamp – Udemy

One of my most recent favorites, The Complete 2023 Web Development Bootcamp by Dr. Angela Yu is one of the best web development courses for beginners I’ve come across.

If you’re not quite sure what area or language to specialize in, this course is the perfect place to try a handful of tools and programming languages on a budget.

5: Learn HTML (Codecademy)

Learn HTML – Codecademy

Learn HTML is a free beginner-level course that walks you through the fundamentals with interactive online lessons.

Codecademy also offers a plethora of other web development courses. Check out their full course catalog here .

6: Responsive Web Design (freeCodeCamp)

Responsive Web Design Curriculum – freeCodeCamp

The Responsive Web Design certification on FreeCodeCamp is great for learning all the basics of web development from scratch for free.

You start with HTML and CSS to get the hang of front-end web dev fundamentals. Then, you start learning new tools and technologies to add to your toolkit, one by one.

Also, check out these roundups with helpful web development courses:

  • 27 Best Web Development Courses (Free and Paid)
  • 20+ Web Development Books for Beginners
  • 120+ Free Places to Learn to Code (With No Experience)
  • 100+ Web Development Tools and Resources

Final thoughts: HTML and CSS project ideas for beginners

There you go!

When it comes to learning HTML and CSS, practice really makes perfect. I hope you found a few inspirational ideas here to start building your next project right away.

Learning HTML and CSS may seem intimidating at first, but when you break it down into small, less-intimidating projects, it’s really not as hard as you might think.

HTML and CSS are easy to learn. You can use them to create really cool, fun projects – even if you are new to coding.

Try these beginner-level HTML and CSS project ideas to improve your front-end web development skills starting now. Do your best to build them without following tutorials.

Remember to add your projects to your portfolio website, too.

It’s possible to learn how to code on your own, and it’s possible to land your first developer job without any formal education or traditional CS degree.

It all boils down to knowing how to apply your skills by building an awesome portfolio of projects like the ones above.

So, which project will you build first? Let me know in the comments below!

Once you feel comfortable with HTML and CSS, it’s time to start learning and practising JavaScript .

To get started, check out my guide with 20+ fun JavaScript projects ideas for beginners . I’ll see you there!

Share this post with others:

About mikke.

html website assignment

Hi, I’m Mikke! I’m a blogger, freelance web developer, and online business nerd. Join me here on MikkeGoes.com to learn how to code for free , build a professional portfolio website , launch a tech side hustle , and make money coding . When I’m not blogging, you will find me sipping strong coffee and biking around town in Berlin. Learn how I taught myself tech skills and became a web dev entrepreneur here . And come say hi on Twitter !

Leave a reply:

Download 15 tips for learning how to code:.

GET THE TIPS NOW

Sign up now to get my free guide to teach yourself how to code from scratch. If you are interested in learning tech skills, these tips are perfect for getting started faster.

Learn to code for free - 15 coding tips for beginners – Free ebook

HTML Projects for Beginners: 10 Easy Starter Ideas

Danielle Richardson Ellis

Published: December 11, 2023

Are you eager to level up your HTML skills? Embarking on HTML projects for beginners is an excellent way to start. As someone who once stood where you are now, I can confidently say that the journey from HTML novice to proficiency is both thrilling and immensely rewarding. It's not just about learning a language; it’s about creating and bringing your ideas to life. 

woman learning html projects for beginners

In my early days of exploring web development, HTML was the cornerstone that laid the foundation for my career. Now, with several years of experience in web development and a passion for being a resource for beginners, I understand the importance of starting with practical, easy-to-follow projects.

In this blog, I'm excited to share with you a curated list of HTML projects that are perfect for beginners. These projects are designed not only to increase your understanding of HTML but also to spark your creativity and enthusiasm for web development.

Streamline Your Coding: 25 HTML & CSS Hacks [Free Guide]

Table of Contents

  • Understanding the Basics
  • Project 1: Personal Portfolio Page
  • Project 2: Simple Blog Layout
  • Project 3: Landing Page
  • Project 4: eCommerce Page
  • Project 5: Recipe Page
  • Project 6: Technical Documentation 
  • Project 7: Small Business Homepage 
  • Project 8: Simple Survey Form
  • Project 9: Event Invitation Page
  • Project 10: Parallax Website

The Road Ahead in Web Development

Understanding the basics: what is html.

Before I dive into the exciting world of HTML projects, I want to share why grasping the basics of HTML is crucial. HTML , which stands for HyperText Markup Language, is the foundational building block of the web. It’s not a programming language, but a markup language that I use to define the structure and layout of a web page through various elements and tags.

To me, HTML is like creating a framework for web content, similar to how an architect designs a building's blueprint. You would use tags to mark up text, insert images, create links, and lay out web pages in a format that browsers can understand and display. These tags , the basic units of HTML, help differentiate between headings, paragraphs, lists, and other content types, giving the web its versatile and user-friendly nature.

html projects for beginners: wireframe example

Every web developer starts somewhere, and for many, including myself, that starting point is HTML. It's a language that empowers me to create, experiment, and develop various digital experiences . So, as we embark on these beginner projects, remember that you're not just learning a new skill. You are stepping into a world full of endless possibilities and opportunities.

10 HTML Projects for Beginners: Your Journey Starts Here

As a web developer passionate about teaching, I‘m thrilled to guide you through this series. This section is crafted to progressively enhance your skills, offering a blend of creativity and learning. I’ve seen firsthand how these projects can transform beginners into confident creators, and I‘m excited to see the unique and innovative web experiences you’ll bring to life. Let's embark on this adventure together, turning code into compelling digital stories!

Project 1: Creating a Personal Portfolio Page

One of the best ways to start your HTML journey is by creating a personal portfolio page. This project allows you to introduce yourself to the world of web development while learning the basics of HTML. It’s not just about coding; it’s about telling your story through the web.

The objective here is to craft a web page that effectively portrays your personal and professional persona. This includes detailing your biography, showcasing your skills, and possibly even including a portfolio of work or projects you've completed. This page will be a cornerstone in establishing your online presence and can evolve as you progress in your career.

See the Pen HTML Project 1 by HubSpot ( @hubspot ) on CodePen .

  • Showcase and Evolve : I'm selecting projects that best represent my abilities, and I plan to continually update my portfolio as I develop new skills.
  • Simplicity and Clarity : My focus is on creating a clear, user-friendly layout that makes navigating my story and achievements effortless for visitors.

Project 2: Building a Simple Blog Layout

After creating a personal portfolio, the next step in your HTML journey is to build a simple blog layout. This project will introduce you to more complex structures and how to organize content effectively on a webpage.

The goal of this project is to create a basic blog layout that includes a header, a main content area for blog posts, and a footer. This layout serves as the foundation for any blog, providing a clear structure for presenting articles or posts.

See the Pen HTML Project 2 by HubSpot ( @hubspot ) on CodePen .

  • Consistency is Key : In designing the blog, I'm focusing on maintaining a consistent style throughout the page to ensure a cohesive look.
  • Content First : My layout will prioritize readability and easy navigation, making the content the star of the show.

Project 3: Designing a Landing Page

For the third project, let's shift gears and focus on creating a landing page. A landing page is a pivotal element in web design, often serving as the first point of contact between a business or individual and their audience. This project will help you learn how to design an effective and visually appealing landing page.

The objective is to create a single-page layout that introduces a product, service, or individual, with a focus on encouraging visitor engagement, such as signing up for a newsletter, downloading a guide, or learning more about a service.

See the Pen HTML Project 3 by HubSpot ( @hubspot ) on CodePen .

  • Clear Call to Action : I'm ensuring that my landing page has a clear and compelling call to action (CTA) that stands out and guides visitors towards the desired engagement.
  • Visual Appeal and Simplicity : My focus is on combining visual appeal with simplicity, making sure the design is not only attractive but also easy to navigate and understand.

Project 4: Crafting an eCommerce Page

Creating an eCommerce page is an excellent project for web developers looking to dive into the world of online retail. This project focuses on designing a web page that showcases products, includes product descriptions, prices, and a shopping cart.

The aim is to build a user-friendly and visually appealing eCommerce page that displays products effectively, providing customers with essential information and a seamless shopping experience. The page should include product images, descriptions, prices, and add-to-cart buttons.

See the Pen HTML Project 4 by HubSpot ( @hubspot ) on CodePen .

  • Clarity and Accessibility : In designing the eCommerce page, my priority is to ensure that information is clear and accessible, making the shopping process straightforward for customers.
  • Engaging Product Presentation : I'll focus on presenting each product attractively, with high-quality images and concise, informative descriptions that entice and inform.

25 html and css coding hacks

Project 5: Developing a Recipe Page

One of the best ways to enhance your HTML and CSS skills is by creating a recipe page. This project is not only about structuring content but also about making it visually appealing. A recipe page is a delightful way to combine your love for cooking with web development, allowing you to share your favorite recipes in a creative and engaging format.

The aim of this project is to design a web page that effectively displays a recipe, making it easy and enjoyable to read. This includes organizing the recipe into clear sections such as ingredients and instructions, and styling the page to make it visually appealing. The recipe page you create can serve as a template for future culinary postings or a personal collection of your favorite recipes.

See the Pen HTML Project 5 by HubSpot ( @hubspot ) on CodePen .

  • Clarity and Simplicity : My focus is on presenting the recipe in an organized manner, ensuring that the ingredients and instructions are easy to distinguish and follow.
  • Engaging Visuals : I plan to use appealing images and a thoughtful layout, making the page not just informative but also a delight to the eyes.

Project 6: Creating a Technical Documentation 

Implementing a responsive navigation menu is a crucial skill in web development, enhancing user experience on various devices. This project focuses on creating a navigation menu that adjusts to different screen sizes, ensuring your website is accessible and user-friendly across all devices.

The goal is to create a navigation menu that adapts to different screen sizes. This includes a traditional horizontal menu for larger screens and a collapsible " hamburger " menu for smaller screens. Understanding responsive design principles and how to apply them using HTML and CSS is key in this project.

See the Pen HTML Project 6 by HubSpot ( @hubspot ) on CodePen .

  • Flexibility is Key : I'm focusing on building a navigation menu that's flexible and adapts smoothly across various devices.
  • Simplicity in Design : Keeping the design simple and intuitive is crucial, especially for the mobile version, to ensure ease of navigation.

Project 7: Building a Small Business Homepage 

Creating a homepage for a small business is a fantastic project for applying web development skills in a real-world context. This project involves designing a welcoming and informative landing page for a small business, focusing on user engagement and business promotion.

The aim is to create a homepage that effectively represents a small business, providing key information such as services offered, business hours, location, and contact details. The design should be professional, inviting, and aligned with the business's branding.

See the Pen HTML Project 7 by HubSpot ( @hubspot ) on CodePen .

  • Clarity and Accessibility : My priority is ensuring that key information is presented clearly and is easily accessible to visitors.
  • Brand Consistency : I plan to incorporate design elements that are in line with the business's branding, creating a cohesive and professional online presence.

Project 8: Setting Up a Simple Survey Form

Creating a simple survey form is a valuable project for practicing form handling in HTML and CSS. It's a fundamental skill in web development, essential for gathering user feedback, conducting research, or learning more about your audience.

The objective of this project is to create a user-friendly survey form that collects various types of information from users. The form will include different types of input fields, such as text boxes, radio buttons, checkboxes, and a submit button. The focus is on creating a clear, accessible, and easy-to-use form layout.

See the Pen HTML Project 8 by HubSpot ( @hubspot ) on CodePen .

  • Simplicity in Design : I'm aiming for a design that's straightforward and intuitive, ensuring that filling out the form is hassle-free for users.
  • Responsive Layout : Ensuring the form is responsive and accessible on different devices is a key consideration in its design.

Project 9: Creating an Event Invitation Page

Designing an event invitation page is a fantastic way to combine creativity with technical skills. This project involves creating a web page that serves as an online invitation for an event, such as a conference, workshop, or party.

The aim is to create a visually appealing and informative event invitation page. This page should include details about the event like the date, time, venue, and a brief description. The focus is on using HTML and CSS to present this information in an engaging and organized manner.

See the Pen HTML Project 9 by HubSpot ( @hubspot ) on CodePen .

  • Visual Impact : I'm aiming for a design that captures the essence of the event, making the page immediately engaging.
  • Clear Information Hierarchy : Organizing the event details in a clear and logical manner is crucial for effective communication.

Project 10: Building a Parallax Website

Creating a parallax website involves implementing a visual effect where background images move slower than foreground images, creating an illusion of depth and immersion. It's a popular technique for modern, interactive web design.

The objective of this project is to create a website with a parallax scrolling effect. This will be achieved using HTML and CSS, specifically focusing on background image positioning and scroll behavior. The key is to create a visually engaging and dynamic user experience.

See the Pen HTML Project 10 by HubSpot ( @hubspot ) on CodePen .

  • Balance in Motion : While implementing parallax effects, I'll ensure the motion is smooth and not overwhelming, to maintain a pleasant user experience.
  • Optimized Performance : I'll be mindful of optimizing images and code to ensure the parallax effect doesn't hinder the site's performance.

As we reach the end of our journey through various web development projects, it's clear that the field of web development is constantly evolving, presenting both challenges and opportunities. From creating basic HTML pages to designing dynamic, interactive websites, the skills acquired are just the beginning of a much broader and exciting landscape.

Embracing New Technologies: The future of web development is tied to the ongoing advancements in technologies. Frameworks like React, Angular, and Vue.js are changing how we build interactive user interfaces. Meanwhile, advancements in CSS, like Flexbox and Grid, have revolutionized layout design, making it more efficient and responsive.

Focus on User Experience: As technology progresses, the emphasis on user experience (UX) will become even more crucial. The success of a website increasingly depends on how well it engages users, provides value, and creates meaningful interactions. Web developers must continuously learn about the latest UX trends and apply them to their work.

The Rise of Mobile-First Development: With the increasing use of smartphones for internet access, mobile-first design is no longer an option but a necessity. This approach involves designing websites for smaller screens first and then scaling up to larger screens, ensuring a seamless experience across all devices.

Web Accessibility and Inclusivity: Making the web accessible to everyone, including people with disabilities, is a growing focus. This includes following best practices and guidelines for web accessibility, ensuring that websites are usable by everyone, regardless of their abilities or disabilities.

Performance and Optimization: As users become more demanding about performance, optimizing websites for speed and efficiency will continue to be a priority. This includes minimizing load times, optimizing images and assets, and writing efficient code.

Emerging Trends: The integration of artificial intelligence and machine learning in web development is on the rise, offering new ways to personalize user experiences and automate tasks. Additionally, the development of Progressive Web Apps (PWAs) is blurring the lines between web and mobile apps, offering offline capabilities and improved performance.

Continuous Learning: The only constant in web development is change. Continuous learning and adaptation are key to staying relevant in this field. Whether it's learning new programming languages, frameworks, or design principles, the ability to evolve with the industry is critical for any web developer.

As you continue on your path in web development, remember that each project is a step towards mastering this ever-changing discipline. Embrace the challenges, stay curious, and keep building, for the road ahead in web development is as exciting as it is limitless.

coding-hacks

Don't forget to share this post!

Related articles.

Onchange Event in HTML: How to Use It [+Examples]

Onchange Event in HTML: How to Use It [+Examples]

HTML Dialog: How to Create a Dialog Box in HTML

HTML Dialog: How to Create a Dialog Box in HTML

How to Create a Landing Page in HTML & CSS [+ 15 Templates]

How to Create a Landing Page in HTML & CSS [+ 15 Templates]

HTML Audio Tag: How to Add Audio to Your Website

HTML Audio Tag: How to Add Audio to Your Website

How to Add an Image & Background Image in HTML

How to Add an Image & Background Image in HTML

How to Call a JavaScript Function in HTML

How to Call a JavaScript Function in HTML

How to Embed Google Map in HTML [Step-By-Step Guide]

How to Embed Google Map in HTML [Step-By-Step Guide]

How to Create a Range Slider in HTML + CSS

How to Create a Range Slider in HTML + CSS

How to Create an HTML Tooltip [+ Code Templates]

How to Create an HTML Tooltip [+ Code Templates]

How to Make an HTML Text Box [Examples]

How to Make an HTML Text Box [Examples]

Tangible tips and coding templates from experts to help you code better and faster.

CMS Hub is flexible for marketers, powerful for developers, and gives customers a personalized, secure experience

KST Learning

  • Virtual University
  • _Assignments
  • __Assignments # 01
  • __Assignments # 02
  • __Assignments # 03
  • _Short Lectures
  • _Past Papers
  • __Final Term
  • _Important Links
  • CS519 & CS619 FYP
  • Paid Projects
  • _C++ Paid Projects
  • _Data Structure Paid Projects
  • _Java Paid Projects
  • _PHP Paid Projects

CS401 & CS401P Assignment 1 Spring 2024 Solution

Cs401 assignment 1 solution code spring 2024, click here to download, cs401p assignment 1 solution code spring 2024, post a comment, contact form.

Tutorials Class - Logo

HTML Exercises

Steps to create a webpage in html using notepad, program to see difference between paragraphs & normal text with line break, write an html program to display hello world., write a program to create a webpage to print values 1 to 5, write a program to create a webpage to print your city name in red color., write a program to print a paragraph with different font and color..

  • HTML Exercises Categories
  • HTML Basics
  • HTML All Exercises & Assignments
  • HTML Top Exercises
  • HTML Paragraphs

John Means fan eight

Orioles pitcher John Means fans eight batters in seven shutout innings during a rehab assignment start for Triple-A Norfolk

  • Send to News MiLB feed
  • Orioles Affiliate
  • More From This Game
  • Norfolk Tides
  • Red Sox Acquire Garrett Cooper
  • Orioles Option Jackson Holliday
  • Wade Miley To Undergo Tommy John Surgery
  • Jesus Luzardo Place On Injured List, Will Undergo Testing Due To Elbow Tightness
  • White Sox To Select Tommy Pham, Designate Kevin Pillar For Assignment
  • Cubs To Place Cody Bellinger On IL With Fractured Rib, Recall Pete Crow-Armstrong
  • Hoops Rumors
  • Pro Football Rumors
  • Pro Hockey Rumors

MLB Trade Rumors

Rangers Designate Jared Walsh For Assignment

By Nick Deeds | April 20, 2024 at 3:16pm CDT

The Rangers announced a series of roster moves this afternoon, led by the club designating first baseman Jared Walsh for assignment. Taking Walsh’s spot on the active roster will be first baseman Nathaniel Lowe , who the club has activate from the 10-day injured list. In addition, Texas announced that catcher Jonah Heim has been placed on the bereavement list, with catcher Sam Huff recalled from Triple-A to take his spot on the big league roster.

Walsh, 30, joined the Rangers on a minor league deal and his .250/.368/.458 slash line in 57 spring plate appearances impressed enough to earn the slugger a spot on Texas’s Opening Day roster when Lowe found himself sidelined by an oblique strain to open the season. It was a reasonable call for the Rangers to make at the time between Walsh’s solid showing this spring and his track record of past success for the Angels, as Walsh had posted an excellent 130 wRC+ in Anaheim across the 2020 and 2021 seasons.

Unfortunately, things haven’t gone well for Walsh since then. He hit a paltry .197/.258/.355 over his final two years with the Halos while battling thoracic outlet syndrome as well as a neurological illness that has caused him to suffer from persistent headaches and insomnia. Through 17 games with the Rangers, Walsh has looked better than he did when he posted a 33 wRC+ with the Angels last year but has nonetheless struggled to a lackluster .226/.317/.321 batting line across 60 trips to the plate in a Rangers uniform.

Of course, it’s difficult to draw significant conclusions from such a small sample size. On one hand, Walsh has posted a strong 11.7% walk rate so far this season and has an xwOBA of .324 that outstrips his .294 wOBA by 30 points, suggesting better days could be ahead for the veteran. On the other, however, Walsh’s 35% strikeout rate is nearing an untenable level and a far cry from the 24.1% rate he flashed during his peaks years with the Angels, and his meager 84 wRC+ is being floated by a .355 BABIP that clocks in more than 50 points above his career mark.

Perhaps most concerning about Walsh’s performance so far is his lack of power. Between the 2020 and ’21 seasons, Walsh hit 38 home runs in just 176 games with an excellent .251 ISO. So far this season, however, he’s managed to connect on just three extra-base hits with one home run. While that could certainly change if he can find more at-bats at the big league level, Walsh’s average exit velocity this year is just 84.2 mph per Statcast . That places him in the fifth percentile among all major league hitters, putting him line with relatively light-hitting players such as Isiah Kiner-Falefa and Gio Urshela .

Even so, Walsh’s max exit velocity of 112.5 mph indicates that his power potential is still there. An above-average 9.4% barrel rate also provides optimism that more power could be in the first baseman’s future, though first he’ll need to find playing time in the majors for that to come to fruition. Going forward, the Rangers will have seven days to either trade, release, or waive the veteran. Any club that claims Walsh off waivers would take on the remainder of his $1.25MM salary for the 2024 campaign, and if he goes unclaimed the Rangers will be able to assign Walsh outright to the minors. Walsh would have the right to reject that assignment in favor of free agency, though in doing so he would forfeit the remainder of his $1.25MM salary of this season.

Walsh’s departure from the active roster makes room for the return of Lowe, who has been the club’s regular first baseman in each of the past three seasons. That arrangement has gone quite well for the Rangers, with Lowe slashing a respectable .276/.359/.441 in 475 games with the club while picking up a Gold Glove award last year in addition to a Silver Slugger award the year prior. In addition to bumping Walsh from the club’s roster, Lowe’s return seems likely to cut into the playing time afforded to utility youngster Ezequiel Duran , who made seven starts at first in Lowe’s absence despite struggling to a 59 wRC+ so far in the young 2024 campaign.

Along with Lowe’s return, Texas announced that catcher Heim is headed to the bereavement list. The 2023 All Star and Gold Glove award winner has been a steady source of production for the club once again this year, impressing defensively behind the plate while posting a respectable 102 wRC+ on offense. The Rangers will be without their top option behind the plate for the next few days, however, and figure to rely on a tandem of Huff and Andrew Knizner while their primary backstop is away. Huff has posted solid numbers in limited playing time at the big league level to this point in his career, with a career .262/.314/.462 slash line in 75 games dating back to the 2020 season. Knizner, meanwhile, has gone 1-for-14 with four strikeouts in limited playing time with Texas to this point in the young 2024 campaign.

21 Comments

' src=

They should designate their overrated hitting prospects. Or just trade lang and Carter

' src=

I agree. Let’s brainstorm some teams who we might be able to trick into taking these overrated prospects.

Man, that sounds like a fantastic idea, hopefully the Rangers front office jumps on the first offer for those overrated prospects.

' src=

“Winning is for losers”- Sun Tzu (I think)

' src=

They just signed him to a $1.25 mil contract and then cut him after 20 games… he wasn’t that terrible a player in small sample size, maybe he was a clubhouse problem…

' src=

Maybe they don’t need two left handed first basemen and are trying to give him a chance to catch on with another team simply for playing time and to continue to revive his career?

' src=

He’ll be making that $1.25 mill at Round Rock.

' src=

More to come? Why?

' src=

All walshed up

' src=

Sure would be nice to see the entire roster play a game or two together.

' src=

The Rangers are playing in Atlanta. He’s from Atlanta area..UGA..Peachtree Ridge H.S. Suwanee, Ga..If the Rangers want to give him a chance to catch on with another team??? He’s close to home now..but are the Braves interested?? They just signed Yuli Gurriel. They have Olson and played Ozuna at 1st base in Spring. It’s only $1.25M, but that would get them close to 3rd tier of Luxury threshold!..So I would say NO for the Braves!

' src=

Bring him back to the Big A Perry.

' src=

I was rooting for him. Looks like he might be toast. He hasn’t been the same since the neurological issues.

Small sample no doubt, but yeah Walsh might be toast sadly…

' src=

Just another mirage from the shortened 2020 “season.” Nothing about that year should count in the history books.

2021 wasn’t a mirage, all star, 29 homers, 850 ops, 144 games

Also the headline should read. Rangers activate Silver Slugger / Gold Glove first basemen Nathaniel Lowe. Walsh isn’t the headline of this article.

' src=

Jared Walsh has done well for a 39th round senior sign!

' src=

Too bad. But life goes on

' src=

well..if the rangers trade their overrated prospects they better get at least 2..no 3..players to be named later.

' src=

“Meanwhile” can’t come in the middle of the sentence between commas, MLBTR. It has to START the sentence.

Leave a Reply Cancel reply

Please login to leave a reply.

Log in Register

html website assignment

  • Feeds by Team
  • Commenting Policy
  • Privacy Policy

MLB Trade Rumors is not affiliated with Major League Baseball, MLB or MLB.com

FOX Sports Engage Network

Username or Email Address

Remember Me

free hit counter

HTML Tutorial

Html graphics, html examples, html references.

An HTML form is used to collect user input. The user input is most often sent to a server for processing.

The <form> Element

The HTML <form> element is used to create an HTML form for user input:

The <form> element is a container for different types of input elements, such as: text fields, checkboxes, radio buttons, submit buttons, etc.

All the different form elements are covered in this chapter: HTML Form Elements .

The <input> Element

The HTML <input> element is the most used form element.

An <input> element can be displayed in many ways, depending on the type attribute.

Here are some examples:

All the different input types are covered in this chapter: HTML Input Types .

Advertisement

Text Fields

The <input type="text"> defines a single-line input field for text input.

A form with input fields for text:

This is how the HTML code above will be displayed in a browser:

Note: The form itself is not visible. Also note that the default width of an input field is 20 characters.

The <label> Element

Notice the use of the <label> element in the example above.

The <label> tag defines a label for many form elements.

The <label> element is useful for screen-reader users, because the screen-reader will read out loud the label when the user focuses on the input element.

The <label> element also helps users who have difficulty clicking on very small regions (such as radio buttons or checkboxes) - because when the user clicks the text within the <label> element, it toggles the radio button/checkbox.

The for attribute of the <label> tag should be equal to the id attribute of the <input> element to bind them together.

Radio Buttons

The <input type="radio"> defines a radio button.

Radio buttons let a user select ONE of a limited number of choices.

A form with radio buttons:

Choose your favorite Web language:

The <input type="checkbox"> defines a checkbox .

Checkboxes let a user select ZERO or MORE options of a limited number of choices.

A form with checkboxes:

The Submit Button

The <input type="submit"> defines a button for submitting the form data to a form-handler.

The form-handler is typically a file on the server with a script for processing input data.

The form-handler is specified in the form's action attribute.

A form with a submit button:

The Name Attribute for <input>

Notice that each input field must have a name attribute to be submitted.

If the name attribute is omitted, the value of the input field will not be sent at all.

This example will not submit the value of the "First name" input field: 

HTML Exercises

Test yourself with exercises.

In the form below, add an input field with the type "button" and the value "OK".

Start the Exercise

Video: HTML Forms

html website assignment

COLOR PICKER

colorpicker

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected]

Top Tutorials

Top references, top examples, get certified.

Two students

Mastery in WebAssign

Build student confidence with multiple opportunities to practice course topics with the latest WebAssign improvement: Mastery .

html website assignment

New Instructor Experience

We're making teaching in WebAssign easier with instructor experience improvements, including a newly redesigned assignment editor.

Get the Details

webassign

Boost Student Motivation & Engagement

Do your students need motivation? Find new ways to engage them in your classroom with active learning.

Two students

The New Instructor Experience is Coming!

Teaching will be easier this fall with instructor experience improvements including a more intuitive site navigation and assignment-creation process. Learn More

Create the Path to Student Success

In the spotlight.

html website assignment

New in WebAssign

Make the most out of your WebAssign experience with new platform features and content. Explore Updates

EVENTS

Events & Recordings

Get the most out of your course in WebAssign with live and recorded webinars that provide peers tips and best practices. Explore More

Cengage unlimited logo

Cengage Unlimited

Unlimited access to quality, affordable course materials.

Join a Community Of Your Peers

Two females and one male profile picture inside circle

Become a Power User

Learn new tips and stay-in-the know with   expert advice , platform updates and current news on the WebAssign blog.   CHECK IT OUT

Students with flags

Stand Out as a Student Ambassador

Make an impact on campus and in your community—while standing out to future employers—by becoming a Student Ambassador. LEARN MORE

Ready to Get Started?

Contact Us Sign In

  • WebAssign/Cengage
  • Centennial Campus, 1791 Varsity Dr., Suite 200
  • Terms of Use
  • Our Partners

Subscribe to our Newsletter

Get the latest tips, news, and developments.

Apple Business Manager User Guide

  • Intro to Apple Business Manager
  • Program requirements
  • Participate in beta features
  • Get support
  • Provide feedback
  • Edit preferences
  • Configure locations
  • Link to new domains
  • About domain conflicts
  • Disconnect federation from a domain
  • Intro to federated authentication
  • Use federated authentication with Google Workspace
  • Use federated authentication with Microsoft Entra ID
  • Use federated authentication with your identity provider
  • Change a user’s domain information
  • Transfer Apple services when federating
  • Sync user accounts from Google Workspace
  • Sync user accounts from Microsoft Entra ID
  • Sync user accounts from your identity provider
  • Get notified about user name conflicts
  • Resolve Apple ID conflicts
  • Resolve Google Workspace sync conflicts
  • Resolve Microsoft Entra ID OIDC sync conflicts
  • Resolve identity provider OIDC or SCIM sync conflicts
  • Use Managed Apple IDs
  • Customize user access to certain apps and services
  • Use Sign in with Apple
  • Intro to users and user groups
  • Manually add users
  • Manage existing users
  • Add user groups
  • Create or reset user passwords
  • Intro to roles and privileges
  • View and assign roles
  • Add Content Managers to locations
  • Add or reset verification phone numbers
  • Intro to buying content
  • Review content payment and billing information
  • Select and buy content
  • Learn about Custom Apps
  • Manage content tokens
  • Transfer licenses
  • Migrate content tokens
  • Invite VPP purchasers
  • Plan for migration to Apps and Books
  • Device workflow
  • Manage device suppliers
  • View device information
  • Get device order progress reports
  • Add devices from Apple Configurator
  • Intro to MDM servers
  • Link to a third-party MDM server
  • Edit a third-party MDM server configuration
  • Delete a third-party MDM server
  • Review device assignments
  • Assign, reassign, or unassign devices
  • Assign a device that was serviced or replaced
  • Release devices
  • Create Shared iPad passcodes
  • Sign in to Shared iPad
  • Shared iPad and Managed Apple IDs
  • Sign federated users out of devices
  • How to search
  • View activity
  • Read log files
  • Keyboard shortcuts
  • Document revision history

html website assignment

Intro to buying content in Apple Business Manager

The App Store features thousands of apps. Fortunately, Apple Business Manager gives your organization a simple way to acquire and manage these apps in the Apps and Books Store. Using device management, you can install and update apps remotely, even if the App Store is disabled on the device.

Note: Depending on your local tax requirements, you may be required to provide tax information when you initially set up your organization to buy content.

The Apple Business Manager window, with Apps and Books selected in the sidebar, and one app selected next to it.

Distributing apps

Besides buying apps, you can also revoke and reassign apps to different devices and users. In this way, you always retain full ownership and control of apps you bought. You can assign the apps you bought through Apple Business Manager to any devices or users in any country or region where those apps are available from that location’s App Store. (The App Store Country or Region is determined by the address submitted when your organization signs up for Apple Business Manager. For example, if your organization signed up with an address in the United States, the App Store locale is set to United States.)

App distribution works best when the app is assigned before devices are configured or given to users. After the user receives the device and completes the Setup Assistant, Apple Business Manager can send the user an invitation by email or push notification. When the user accepts the invitation, the user has access to all of the apps—which are then remotely installed on the user’s devices.

Note: In-app purchases and subscriptions aren’t compatible with volume purchasing, Managed Apps, or Managed Apple IDs . Developers may offer a separate full-featured version of their apps (sometimes as a Custom App) for education or enterprise customers that need to deploy apps at scale.

Distribute Apple Books

Apple Books bought through Apple Business Manager can be distributed only to users, not devices. They can’t be revoked and reassigned. When books are assigned to users, those books follow the same country and region download restrictions as apps.

Note: Some Apple Books content isn’t available in certain countries or regions. To learn whether certain Apple Books content is available in your country or region, see the Apple Support article Availability of Apple programs and payment methods for education and business .

Recommendations

To simplify your deployment, it’s highly recommended that you assign apps to devices instead of users. With device-based app assignment, there’s no invitation process or requirement to use an Apple ID on the device. Books can’t be assigned to devices.

To alleviate bandwidth saturation during the initial mass deployment, consider distributing only the apps necessary for the first day of deployment, and then make additional apps available to users for download over time. If the device is supervised, apps are installed silently.

App and book assignment summary

The table below shows the types of apps or books, and the criteria for assigning them to devices and users.

IMAGES

  1. HTML Practical Assignment, HTML Assignments for Students With Code

    html website assignment

  2. Creating A Website Using Html Css And Javascript Tutorial Tutorial

    html website assignment

  3. Solved Responsive Web Design (RWD) Assignment Modify the

    html website assignment

  4. 9.1 HTML Assignment on Lists

    html website assignment

  5. HTML Assignment by obm255.mooc

    html website assignment

  6. 7 Projects to practice HTML & CSS skills for beginners

    html website assignment

VIDEO

  1. How to Start Your Student Website Assignment

  2. Wordpress Development: Building the one page website assignment with elementor

  3. Copy of Website assignment.pptx (2)

  4. Website About Us Design Using HTML5 and CSS3 in Urdu/Hindi 2024

  5. DEC 2023 Assignment Online Submit होगा या Offline?

  6. [1] How To Create a Responsive Website Using HTML & CSS For Beginners

COMMENTS

  1. HTML Exercises

    Learn the basics of HTML in a fun and engaging video tutorial. Templates. We have created a bunch of responsive website templates you can use - for free! Web Hosting. Host your own website, and share it to the world with W3Schools Spaces. Create a Server. Create your own server using Python, PHP, React.js, Node.js, Java, C#, etc. ...

  2. HTML Exercises, Practice Questions and Solutions

    Embark on your HTML learning journey by accessing our online practice portal. Choose exercises suited to your skill level, dive into coding challenges, and receive immediate feedback to reinforce your understanding. Our user-friendly platform makes learning HTML engaging and personalized, allowing you to develop your skills effectively.

  3. Getting started with HTML

    If you want to experiment with writing some HTML on your local computer, you can: Copy the HTML page example listed above. Create a new file in your text editor. Paste the code into the new text file. Save the file as index.html. Note: You can also find this basic HTML template on the MDN Learning Area GitHub repo.

  4. HTML Assignment| HTML Exercise and Examples

    Assignment 1. Assignment 2. Assignment 3. Assignment 4 (Web Infomax Invoice) Assignment 5 (Web Layout) Assignment 6 (Periodic Table) UNIT - 6.

  5. The HTML Handbook

    HTML, a shorthand for Hyper Text Markup Language, is one of the most fundamental building blocks of the Web. HTML was officially born in 1993 and since then it evolved into its current state, moving from simple text documents to powering rich Web Applications. This handbook is aimed at a vast audience. First, the beginner.

  6. Practice Projects in HTML & CSS

    Challenge Project: Build a Website Design System. HTML & CSS • Web Development • Web Design Build a style guide for your web projects, including custom fonts, colors, text styles, and more. Less guidance, 180 min. Practice Project.

  7. HTML All Exercises & Assignments

    Write a program to print a paragraph with different font and color. Description: Create a webpage to print a paragraph with 4 - 5 sentences. Each sentence should be in a different font and color.

  8. Intro to HTML/CSS: Making webpages

    Practice. Learn how to use HTML and CSS to make webpages. HTML is the markup language that you surround content with, to tell browsers about headings, lists, tables, and more. CSS is the stylesheet language that you style the page with, to tell browsers to change the color, font, layout, and more.

  9. HTML basics

    HTML (HyperText Markup Language) is the code that is used to structure a web page and its content. For example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and data tables. As the title suggests, this article will give you a basic understanding of HTML and its functions.

  10. Document and website structure

    Document and website structure. In addition to defining individual parts of your page (such as "a paragraph" or "an image"), HTML also boasts a number of block level elements used to define areas of your website (such as "the header", "the navigation menu", "the main content column"). This article looks into how to plan a basic website ...

  11. Learn HTML

    HTML (HyperText Markup Language) is a language used for creating webpages which is the fundamental building block of the Web. One thing to remember about HTML is that it is a markup language with no programming constructs. Instead, the language provides us with a structure to build web pages. Using HTML, we can define web page elements such as ...

  12. 32 HTML And CSS Projects For Beginners (With Source Code)

    In this project, you'll create a simple blog post page using HTML and CSS. You'll need to design the layout of the page, add a title, a featured image, and of course add some content to your dummy blog post. You can also add a sidebar with a few helpful links and widgets, like: An author bio with a photo.

  13. How To Build a Website with HTML

    Copy the full path of your file and paste the file in your browser bar. If you are using the Visual Studio Code text editor, you can copy the file path using CTRL + Left Click (on Macs) or Right Click (on Windows) on the file "index.html" in the left hand panel and selecting "Copy Path.".

  14. HTML Basics

    A website is simply a collection of web-pages. A web page or web documents written in HTML (HyperText Markup Language). These Web pages can be viewed using any web browser and Internet. Html Language is used to write code and programs to create a webpage. It is easy to create a webpage and you can learn it with few basic steps mentioned below:

  15. HTML Tutorial

    Learn how to create and style web pages with HTML, the standard markup language for the web. W3Schools HTML Tutorial offers easy and interactive examples, exercises, quizzes, and references to help you master HTML. Whether you are a beginner or a professional, you will find something useful in this tutorial.

  16. Introduction to HTML

    HTML stands for Hyper Text Markup Language. HTML is the standard markup language for creating Web pages. HTML describes the structure of a Web page. HTML consists of a series of elements. HTML elements tell the browser how to display the content. HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is ...

  17. Assignment #4: HTML Me Something

    Assignment #4: HTML Me Something¶ You've learned a bit of HTML and some CSS, but you have likely only used it in bits and pieces so far, adding or modifying content in exercises or pre-existing files. Here, you are going to take another step forward by building an entire page from scratch. You will also get some practice using Git.

  18. How To Make a Website

    First Step - Basic HTML Page. HTML is the standard markup language for creating websites and CSS is the language that describes the style of an HTML document. We will combine HTML and CSS to create a basic web page. Note: If you don't know HTML and CSS, we suggest that you start by reading our HTML Tutorial.

  19. HTML Projects for Beginners: 10 Easy Starter Ideas

    Project 4: Crafting an eCommerce Page. Creating an eCommerce page is an excellent project for web developers looking to dive into the world of online retail. This project focuses on designing a web page that showcases products, includes product descriptions, prices, and a shopping cart.

  20. WebAssign

    We're making teaching in WebAssign easier with instructor experience improvements, including a more intuitive site navigation and assignment-creation process. Learn More. Boost Student Motivation & Engagement. Do your students need motivation? Find new ways to engage them in your classroom with active learning. Learn More

  21. CS401 & CS401P Assignment 1 Spring 2024 Solution

    CS401 Assignment 1 Solution Code Spring 2024 Click Here To Download CS401P Assignment 1 Solution Code Spring 2024 Click Here To Download

  22. HTML Exercises

    These tutorials are well structured and easy to use for beginners. With each tutorial, you may find a list of related exercises, assignments, codes, articles & interview questions. This website provides tutorials on PHP, HTML, CSS, SEO, C, C++, JavaScript, WordPress, and Digital Marketing for Beginners. Start Learning Now.

  23. John Means fan eight

    The Official Site of Minor League Baseball web site includes features, news, rosters, statistics, schedules, teams, live game radio broadcasts, and video clips.

  24. Rangers Designate Jared Walsh For Assignment

    Walsh would have the right to reject that assignment in favor of free agency, though in doing so he would forfeit the remainder of his $1.25MM salary of this season.

  25. HTML Forms

    The HTML <form> element is used to create an HTML form for user input: <form>. . form elements. . </form>. The <form> element is a container for different types of input elements, such as: text fields, checkboxes, radio buttons, submit buttons, etc. All the different form elements are covered in this chapter: HTML Form Elements .

  26. WebAssign

    We're making teaching in WebAssign easier with instructor experience improvements, including a newly redesigned assignment editor. Get the Details. Boost Student Motivation & Engagement. Do your students need motivation? Find new ways to engage them in your classroom with active learning. Learn More

  27. Intro to buying content in Apple Business Manager

    Recommendations. To simplify your deployment, it's highly recommended that you assign apps to devices instead of users. With device-based app assignment, there's no invitation process or requirement to use an Apple ID on the device. Books can't be assigned to devices.