Courses / HTML
Free Beginner Web Development

HTML & Web Foundations

Learn how websites are structured from the ground up using HTML. Build real pages while learning elements, attributes, links, images, forms, tables, semantic HTML and more.

24
Lessons
4 Weeks
Duration
46%
Progress

Lesson 12 of 24

12 min learning time

Div and Span

The div element

div is a generic block-level container that can be used to group content.

The span element

span is an inline container commonly used when a small portion of text needs special styling or scripting.

Example HTML
<div>
    <h2>Student Profile</h2>

    <p>
        Name:
        <span>John</span>
    </p>
</div>

Practical Exercise

Build it yourself

Create a profile card using a div containing a heading and several paragraphs.

Quick Check

Test your understanding

Which element is normally an inline container?