Html block and inline
2012-06-02 21:16
344 查看
HTML elements can be grouped together with <div> and <span>
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>
Inline elements are normally displayed without starting a new line.
Examples: <b>, <td>, <a>, <img>
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 tables is not the correct use of the <table> element. The purpose of
the <table> element is to display tabular data.
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 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 tables is not the correct use of the <table> element. 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 inline 与block元素
- html使用display:inline-block实现标签右对齐,值左对齐效果。和设置div宽度,并居中显示。嵌套div的里层div文字居中显示
- HTML&CSS——display:inline-block;
- HTML display:inline-block
- Block and Inline
- HTML5 display:inline、block、inline-block的区别--备用
- [HTML]display:inline、block、inline-block的区别
- [CSS3] CSS Display Property: Block, Inline-Block, and Inline
- display:inline-block的两个div不在html中放一行会对页面产生影响
- HTML样式长文本行断行解决方法display:inline-block
- 实现三个div同一行显示,IE6 and Ie7 :display:inline-block
- HTML----CSS display (block none inline)属性淡说
- display:block与display:inline-block在input中的使用区别
- IE6/Ie7 display:inline-block 不起作用(转载)
- c++ friend functions and inline functions
- IE6/IE7不识别display:inline-block属性怎么办
- 拜拜了,浮动布局-基于display:inline-block的列表布局
- [CSS]详解display:inline | block |inline-block的区别
- display:inline-block
- expected '<document start>', but found BlockMappingStart in 'reader', line 13, column 1:nimbus.host: