0% found this document useful (0 votes)
22 views2 pages

HTML and

The document discusses the HTML <div> and <span> elements. <div> is a block-level element that can be used to group other elements and set style attributes to large blocks of content, often for document layout. <span> is an inline element that can be used to group text and set style attributes to parts of text. Both <div> and <span> have no special meaning on their own but can be styled with CSS.

Uploaded by

ManishKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

HTML and

The document discusses the HTML <div> and <span> elements. <div> is a block-level element that can be used to group other elements and set style attributes to large blocks of content, often for document layout. <span> is an inline element that can be used to group text and set style attributes to parts of text. Both <div> and <span> have no special meaning on their own but can be styled with CSS.

Uploaded by

ManishKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

HTML <div> and <span>

Previous
Next Chapter

HTML elements can be grouped together with <div> and <span>.

HTML Block Elements


Most HTML elements are defined as block level elements or as inline elements.
Block level elements normally start (and end) with a new line when displayed in a browser.
Examples: <h1>, <p>, <ul>, <table>

HTML Inline Elements


Inline elements are normally displayed without starting a new line.
Examples: <b>, <td>, <a>, <img>

The HTML <div> Element


The HTML <div> element is a block level element that can be used as a container for grouping
other HTML elements.
The <div> element has no special meaning. Except that, because it is a block level element, the
browser will display a line break before and after it.
When used together with CSS, the <div> element can be used to set style attributes to large
blocks of content.
Another common use of the <div> element, is for document layout. It replaces the "old way" of
defining layout using tables. Using <table> elements for layout is not the correct use of <table>.
The purpose of the <table> element is to display tabular data.

The HTML <span> Element


The HTML <span> element is an inline element that can be used as a container for text.
The <span> element has no special meaning.
When used together with CSS, the <span> element can be used to set style attributes to parts of
the text.

HTML Grouping Tags


Tag
Description
<div> Defines a section in a document (block-level)
<span> Defines a section in a document (inline)

You might also like