HTML can combine elements through Most HTML elements are defined as block-level or inline elements. When block-level elements are displayed in a browser, they usually start (and end) with a new line. Example: Inline elements are usually displayed without starting with a new line. Example: HTML If used with CSS HTML The When used with CSS Label Description < div > Defines the area of the document, block level < span > Used to combine inline elements in a document, inline elements (inline)
<div>
and
<span>
. 11.16.1. HTML block element ¶
<h1>
,
<p>
,
<ul>
,
<table>
11.16.2. HTML inline elements ¶
<h1>
,
<p>
,
<ul>
,
<table>
11.16.3. HTML < div > element ¶
<div>
elements are block-level elements that can be used to combine containers of other HTML elements.
<div>
elements have no specific meaning. In addition, because it is a block-level element, the browser displays line breaks before and after it.
<div>
element can be used to set style attributes on large blocks of content.
<div>
another common use of elements is document layout. It replaces theold-fashioned method of using tables to define layouts. Use
<table>
element for document layout is not the correct use of tables. The
<table>
purpose of the element is to display tabulated data. 11.16.4. HTML < span > element ¶
<span>
elements are inline elements that can be used as containers for text
<span>
element also has no specific meaning.
<span>
element can be used to set style properties for part of the text. 11.16.5. HTML grouping label ¶