Welcome to the world of HTML! If you're a designer, you might be used to working with visual tools like Sketch, Figma, or Adobe XD. Now, we're going to explore how your beautiful designs actually come to life on the web. Think of HTML as the skeleton that gives structure to everything you see online-without it, there would be no foundation for your colors, typography, or layouts to exist.
Don't worry if code feels intimidating at first. HTML is one of the most beginner-friendly languages because it's designed to be readable by humans. By the end of this document, you'll understand how to read HTML, write basic markup, and most importantly, bridge the gap between your design files and actual web pages.
HTML stands for HyperText Markup Language. Let's break that down:
Here's a helpful analogy: imagine you're creating a poster. In the design world, you might drag and drop text boxes, images, and shapes. HTML does something similar, but instead of dragging, you write tags that tell the browser "this is a heading," "this is a paragraph," or "this is an image."
This is an important distinction. HTML doesn't have logic, loops, or calculations. It's a markup language, which means it structures and describes content. Think of it like the labels in a filing system-it organizes information but doesn't perform actions on it. That's what JavaScript is for, but we're getting ahead of ourselves!
The fundamental building block of HTML is the tag. Tags are like containers or wrappers that tell the browser what type of content is inside.
Most HTML tags come in pairs: an opening tag and a closing tag. Here's what they look like:
<p>This is a paragraph.</p>
Let's break this down:
Together, the opening tag, content, and closing tag form what we call an element.
Some HTML tags don't need a closing tag because they don't wrap around content. These are called self-closing tags or void elements. For example:
<img src="https://cn.edurev.in/hoto.jpg" alt="A beautiful sunset">
<br>
<hr>
These tags represent things that don't have "content" inside them-an image is just an image, a line break is just a break, and a horizontal rule is just a dividing line.
Elements can be placed inside other elements. This is called nesting, and it's how we create structure in HTML. Think of it like Russian nesting dolls:
<div>
<h2>Welcome</h2>
<p>This is inside the div.</p>
</div>
The div is the parent element, and the h2 and p are child elements. Proper nesting is crucial-you must close tags in the reverse order you opened them.
Every HTML page follows a basic template. Think of it like the standard layout of a business letter-there's a header section with metadata and a body section with the actual content.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Web Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first web page.</p>
</body>
</html>
Let's examine each part:
<!DOCTYPE html> tells the browser that this document is written in HTML5, the current version of HTML. It's not actually an HTML tag-it's an instruction to the browser. Always put this at the very top of your HTML file.
<html> is the root element that wraps all the content on your page. The lang="en" attribute specifies the language (English in this case), which helps screen readers and search engines.
The <head> contains metadata-information about the page that doesn't appear on the screen. This includes:
As a designer, you might also add links to CSS stylesheets and fonts in the head section.
The <body> contains all the visible content-everything users actually see and interact with. All your headings, paragraphs, images, buttons, and navigation go here.
Now let's explore the most common HTML elements you'll use as a designer. These are the building blocks that correspond to the components in your design files.
HTML provides six levels of headings, from <h1> to <h6>:
<h1>Main Title</h1>
<h2>Section Heading</h2>
<h3>Subsection Heading</h3>
<h4>Minor Heading</h4>
<h5>Small Heading</h5>
<h6>Smallest Heading</h6>
Think of these like the text hierarchy in your design system. <h1> is typically the largest and most important-usually the page title. Use only one <h1> per page. The other headings create a logical outline of your content.
As a designer, you might have different text styles in Figma labeled "Heading 1," "Heading 2," etc. These correspond directly to HTML heading tags!
The <p> tag is for regular body text:
<p>This is a paragraph of text. It can be as long or short as you need.</p>
Browsers automatically add some spacing above and below paragraphs. Each <p> element starts on a new line.
If you need to break a line without starting a new paragraph, use <br>:
First line<br>
Second line
To add a horizontal dividing line (like the ones in this document), use <hr>:
<hr>
HTML provides several tags for emphasizing or formatting text:
Example:
<p>This is <strong>very important</strong> and this is <em>emphasized</em>.</p>
Note: There are also <b> and <i> tags that make text bold and italic, but <strong> and <em> are preferred because they convey meaning, not just appearance.
Lists are everywhere in web design-navigation menus, feature lists, steps in a process. HTML has three types of lists:
<ul> creates a bulleted list:
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul>
<ol> creates a numbered list:
<ol>
<li>First step</li>
<li>Second step</li>
<li>Third step</li>
</ol>
<dl> creates a list of terms and their definitions:
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
Links are what make the web a "web"-they connect pages together. The <a> tag (anchor) creates links:
<a href="https://www.example.com">Click here</a>
The href attribute (we'll discuss attributes in detail shortly) specifies where the link goes. You can link to:
As a designer, you create clickable buttons and navigation menus. In HTML, these are often built with <a> tags styled with CSS.
To make a link open in a new browser tab, add the target attribute:
<a href="https://www.example.com" target="_blank">Visit Example</a>
This is commonly used for external links, so users don't navigate away from your site.
Images are crucial for designers! The <img> tag displays images on web pages:
<img src="https://cn.edurev.in/hoto.jpg" alt="A description of the image">
Let's look at the two required attributes:
The alt attribute serves multiple purposes:
As a designer, you should write descriptive alt text that conveys the meaning and content of each image. For decorative images that don't add information, use an empty alt attribute: alt="".
You can specify image dimensions with width and height attributes:
<img src="https://cn.edurev.in/hoto.jpg" alt="Sunset" width="600" height="400">
However, it's generally better to control sizing with CSS rather than HTML attributes, giving you more flexibility for responsive design.
The src can be:
We've already seen several attributes (href, src, alt, etc.). Let's formalize what they are.
Attributes provide additional information about HTML elements. They're always specified in the opening tag and usually come in name/value pairs:
<element attribute="value">content</element>
Some attributes work with many different elements:

The id attribute gives an element a unique identifier-no two elements should have the same id on a page:
<div id="navigation">...</div>
IDs are useful for:
The class attribute lets you group elements together. Multiple elements can share the same class, and an element can have multiple classes:
<p class="highlight">First paragraph</p>
<p class="highlight important">Second paragraph</p>
Classes are primarily used for CSS styling. As a designer, you'll use classes extensively to apply your design system-think of them as style names you might use in design software.
Modern HTML emphasizes semantic markup-using tags that describe the meaning of content, not just its appearance. This makes your code more accessible, SEO-friendly, and maintainable.
Before we discuss semantic elements, let's look at two generic containers:
<div> (division) is a block-level container with no semantic meaning. It's like a generic box:
<div>
<h2>Section Title</h2>
<p>Some content</p>
</div>
<span> is an inline container, used to style or target small pieces of text:
<p>The price is <span class="highlight">$29.99</span></p>
Think of divs as large building blocks and spans as small pieces of text you want to mark up within a line.
HTML5 introduced semantic elements that describe the role of content sections. These replace generic divs with meaningful tags:

Here's how a typical page structure might look:
<header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
</header>
<main>
<article>
<h1>Article Title</h1>
<p>Article content...</p>
</article>
</main>
<footer>
<p>© 2024 Company Name</p>
</footer>
As a designer, think of these semantic tags as corresponding to the sections in your wireframes or mockups-header, navigation, main content area, sidebar, and footer.
Tables display data in rows and columns. They should only be used for tabular data, not for page layout (that's what CSS is for).
A table consists of several elements working together:
<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alice</td>
<td>28</td>
</tr>
<tr>
<td>Bob</td>
<td>34</td>
</tr>
</tbody>
</table>
Let's break down the structure:
Think of tables like spreadsheets-each <tr> is a row, and each <td> or <th> is a cell within that row.
Forms collect user input-contact forms, search bars, login screens, etc. As a designer, you design these interfaces; as a developer, you need to know how to build them in HTML.
The <form> element wraps all form inputs:
<form action="/submit" method="POST">
Form inputs go here
</form>
The action attribute specifies where to send the form data, and method specifies how to send it (usually POST or GET).
The <input> element creates various form controls. The type attribute determines what kind:
<input type="text" name="username" placeholder="Enter username">
<input type="email" name="email" placeholder="Enter email">
<input type="password" name="password">
<input type="number" name="age" min="0" max="120">
<input type="date" name="birthday">
<input type="checkbox" name="subscribe" id="subscribe">
<input type="radio" name="gender" value="male" id="male">
<input type="submit" value="Submit">
Every input should have an associated <label> for accessibility:
<label for="username">Username:</label>
<input type="text" id="username" name="username">
The for attribute connects the label to the input through the input's id. This allows users to click the label to focus the input.
For multi-line text input, use <textarea>:
<label for="message">Message:</label>
<textarea id="message" name="message" rows="4" cols="50"></textarea>
The <select> element creates dropdown menus:
<label for="country">Country:</label>
<select id="country" name="country">
<option value="us">United States</option>
<option value="uk">United Kingdom</option>
<option value="ca">Canada</option>
</select>
Buttons can be created with either <button> or <input type="button">:
<button type="submit">Submit Form</button>
<button type="button">Click Me</button>
The <button> element is more flexible because you can put other HTML (like icons) inside it.
Comments let you add notes in your code that browsers ignore. They're useful for documentation and temporarily hiding code:
<!-- This is a comment -->
<!--
This is a multi-line comment
that spans several lines
-->
As a designer-developer, use comments to explain your code structure, mark sections, or leave notes for yourself and teammates.
Understanding the difference between block and inline elements is crucial for layout:
Block elements take up the full width available and start on a new line. Examples include:
Think of block elements as building blocks that stack vertically, like boxes in a warehouse.
Inline elements only take up as much width as needed and don't start a new line. Examples include:
Inline elements flow within text, like words in a sentence.
Here's an example showing the difference:
<p>This is a block element.</p>
<p>This is another block element.</p>
<p>This contains an <span>inline element</span> within it.</p>
The first two paragraphs will stack vertically. The span inside the third paragraph will flow within the text without breaking to a new line.
When building websites, proper file organization and understanding file paths is essential.
Relative paths specify file locations relative to the current file:
Absolute paths start from the root of your website or include the full URL:
Here's a common way to organize a web project:
project-folder/
├── index.html
├── about.html
├── css/
│ └── styles.css
├── images/
│ ├── logo.png
│ └── photo.jpg
└── js/
└── script.js
From index.html, you would reference the logo as "images/logo.png".
As a designer who codes, accessibility should be a core consideration. HTML provides many built-in accessibility features when used correctly.
Using semantic elements (header, nav, main, article, etc.) automatically improves accessibility because screen readers understand these elements' purposes.
Always provide meaningful alt text for images that convey information. For decorative images, use an empty alt attribute to tell screen readers to skip them.
Use headings in order (h1, then h2, then h3) without skipping levels. Screen reader users often navigate by headings, so proper structure is crucial.
Always associate labels with inputs. This helps everyone, but it's essential for screen reader users and people who benefit from larger click targets.
Ensure all interactive elements can be accessed with a keyboard. Links and buttons are keyboard-accessible by default, but custom interactive elements need special attention.
Let's look at a complete example that incorporates many elements we've covered:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portfolio - Jane Designer</title>
</head>
<body>
<header>
<h1>Jane Designer</h1>
<nav>
<ul>
<li><a href="#about">About</a></li>
<li><a href="#work">Work</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section id="about">
<h2>About Me</h2>
<img src="https://cn.edurev.in/mages/profile.jpg" alt="Jane Designer smiling">
<p>I'm a <strong>UI/UX designer</strong> passionate about creating beautiful, accessible experiences.</p>
</section>
<section id="work">
<h2>My Work</h2>
<article class="project">
<h3>E-commerce Redesign</h3>
<img src="https://cn.edurev.in/mages/project1.jpg" alt="Screenshot of e-commerce homepage">
<p>A complete redesign focusing on mobile-first experience.</p>
<a href="project1.html">View case study →</a>
</article>
</section>
<section id="contact">
<h2>Get in Touch</h2>
<form action="/submit" method="POST">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="message">Message:</label>
<textarea id="message" name="message" rows="5"></textarea>
<button type="submit">Send Message</button>
</form>
</section>
</main>
<footer>
<p>© 2024 Jane Designer. All rights reserved.</p>
<p>Follow me on <a href="https://twitter.com/janedesigner" target="_blank">Twitter</a></p>
</footer>
</body>
</html>
This example shows a complete portfolio page structure with semantic HTML, proper heading hierarchy, images with alt text, navigation, and a contact form.
As a designer learning HTML, you're building a bridge between visual design and code. Here's how HTML fits into your workflow:
When you look at a design in Figma, Sketch, or XD, think about the underlying HTML structure:
Your design system's components (buttons, cards, navigation bars) are built with HTML and styled with CSS. Understanding HTML helps you create more developer-friendly design specifications.
When you understand HTML:
It's important to understand HTML's limitations. HTML provides structure, but it doesn't:
Think of building a website like building a house:
As a designer, you'll primarily work with HTML and CSS together. HTML creates the structure, and CSS brings your visual design to life.
As you start writing HTML, keep these principles in mind:
Use elements that describe content meaning, not appearance. Instead of <div class="header">, use <header>. This improves accessibility and SEO.
Don't over-complicate your HTML. Use the simplest structure that accomplishes your goal. Unnecessary nested divs make code harder to maintain.
Always include alt text for images, use proper heading hierarchy, and ensure forms have labels. Accessible HTML benefits everyone.
Indent nested elements to make your code readable. Most developers use 2 or 4 spaces per indentation level.
Add comments to explain sections, especially in complex structures. Your future self (and your teammates) will thank you.
Use an HTML validator to check for errors. Proper HTML is more likely to work consistently across browsers.
Keep HTML clean and minimal. Extra elements slow down page loading and make CSS harder to write.
You now have a solid foundation in HTML! You understand the basic structure of HTML documents, common elements, attributes, semantic markup, and how HTML fits into the larger web development picture.
The next natural step is learning CSS (Cascading Style Sheets), which will let you style your HTML to match your designs. CSS is where you'll control colors, typography, spacing, layout-all the visual aspects you work with daily as a designer.
Remember: HTML is a skill you develop through practice. Start by viewing the source code of websites you admire. Try hand-coding simple pages. Gradually, reading and writing HTML will become second nature.
As a designer who understands HTML, you have a valuable skill that makes you more effective at your job. You can prototype faster, communicate better with developers, and create more technically sound designs. You're not just designing for screens-you're designing for the web.
Welcome to the intersection of design and code. It's a powerful place to be.