HTML
and

HTML block-level elements

and inline elements


##The width of block-level elements fills the entire visible area of the browser, Generally, there can only be one block-level element in a line

The width of an inline element is generally based on the text content within the element. Multiple inline elements can be placed within a block-level element

Example

Let’s first look at the characteristics of the block-level element
and the inline element

    php中文网(php.cn) 
hello
world

Program running results:

1.jpg


##Block-level elements

Block-level elements will occupy one line by default. , the width will automatically fill the width of the parent element. Therefore, multiple cross-level elements are displayed on multiple lines from top to bottom.

Block-level elements: div, p, form, ul, li, ol, dl, table…


Inline element

Inline The element will not occupy an exclusive line, and its width will change according to the content inside. Multiple in-line elements will be arranged in a row next to each other, and will not be broken until one row cannot fit.

Inline elements: span, strong, em, br, img, input, label, select, textarea, cite……


HTML grouping tag

##
defines the area of the document, block-level Used to combine inline elements in the document, inline elements (inline)
Tag Description

##We learned earlier There are so many tags. In the next section, we will teach you how to use those tags to make a simple web page layout

Continuing Learning
||
php中文网(php.cn)
div 块级元素
span行内元素
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!