copied from:http://www.w3school.com.cn/html/html_forms.asp
Most HTML elements are defined as block-level elements or inline elements.
- Block-level elements usually start (and end) with a new line when the browser is displayed. Example:
- Inline elements typically do not start with new lines when they are displayed. Example:<b>, <td>, <a>,
"Note" , "block-level element " is translated as blocklevels," inline elements " translated into the inlineelement.
1.div Elements
HTML <div> elements are block-level elements that are containers that you can use to combine other HTML elements.
The <div> element has no specific meaning. In addition, because it belongs to a block-level element, the browser displays the folded line before and after it.
if used with CSS , the<div> element can be used to set style properties on large chunks of content.
Another common use of the <div> element is the document layout. It replaces the old-fashioned way of using tables to define layouts. Using the <table> element for document layout is not the correct use of the table. The function of the <table> element is to display tabular data.
2.span Elements
HTML <span> elements are inline elements that can be used as containers for text.
The <span> element also has no specific meaning.
when used with CSS , the<span> element can be used to set style properties for some text.
3. example of layout using div
<! DOCTYPE html>4. using table for layout
<! DOCTYPE html>