Latest web development tutorials

HTML Block

HTML via <div> and <span> elements combine.


HTML block element

Most HTML elements are defined as block-level elements or inline elements.

Block-level elements in the browser display, usually to begin (and end) with a new line.

Examples: <h1>, <p>, <ul>, <table>


HTML inline elements

When displaying inline elements do not usually begin with a new line.

Examples: <b>, <td>, <a>, <img>


HTML <div> element

HTML <div> element is a block-level element, it can be used in combination with other container HTML elements.

<Div> element has no specific meaning. In addition, because it belongs to block-level element, the browser will show off their front line.

If used with CSS, <div> element can be used to set style properties for large blocks of content.

Another common use <div> element is the document layout. It replaces the use tables to define the layout of the old fashioned way. Use <table> elements in the document layout is not the correct usage of the table. Role <table> element is to display tabular data.


HTML <span> element with

HTML <span> element is an inline element, the container can be used as text

<Span> element has no specific meaning.

When used together with CSS, <span> element can be used to set style attributes to parts of the text.


HTML tag grouping

标签 描述
<div> 定义了文档的区域,块级 (block-level)
<span> 用来组合文档中的行内元素, 内联元素(inline)