web front-end entry to combat: html and understanding the difference between block elements and row-level elements

Inline, a block difference elements:

1. The elements within the row-level function block can be converted each other to the switching element and the line within the block-level by modifying the value of display elements, inline elements display: inline, block-level elements display: block.

2. Run the other elements and the line elements are arranged in a horizontal line they are in the same row; block elements arranged in it always starts a new line, each of the block elements on a separate line, arranged vertically downwards, To sort it in the horizontal direction, can be used around a floating (float: left / right) are arranged in the horizontal direction allowed.

3. The element can be disposed within the line width and height, width, height variation with changes in the text, but can be set high row (line-height), while in the inactive margins margin provided vertically and horizontally active, inactive, the packed padding down, left and right effective; wide block elements can be set high, and the width and height from the outside, the filling can be arbitrarily controlled.

4. The block elements can contain inline elements and block elements, it can also accommodate inline and other elements; inline element can not contain block elements only receiving text or other inline elements.

Inline, a block element characteristics

In the standard document flow inside the block elements have the following characteristics:

① always start on a new line, occupying an entire row;
② height, line height, and margins and padding can be controlled;
③ broadband browser width is always the same, regardless of the content;
④ it can accommodate inline elements and other block elements.

Features inline elements:

① and other elements on one line;
high ②, line height, and the outer portion and Padding may be varied;
③ width only related to the content;
the only element receiving the text line ④ or other inline elements.

Width and height can not be set, the width increases as the content, the font size is changed with the height of the inline elements may be disposed outside the border, but not up and down the outer boundary functions, acting only on the left, may be provided within the boundary, but not up and down within the boundaries of work in ie6, it can only work for about

Small partners interested in the web front end this technology can be added to our study circle, the sixth year of work, learning to share some with you to develop practical details that need attention. 767-273-102 autumn dress. From the zero-based front-end to learn how to start. Are a group of people with a dream, we may be in different cities, but we will walk together with the front tip of the tip

Block-level elements are there?

address custom address
caption Defines a table caption
definition list dd defined entry
partition or section div defined in the document
dl definition list
items definition list dt in the
fieldset to define a framework set
form to create HTML forms
h1 defines the maximum title
h2 define subtitle
h3 custom title
h4> Custom title
h5 custom title
h6 define the minimum title
hr create a horizontal
legend for the fieldset element element defines the title
li tag defines the list of items
noframes text for those who do not support the browser frame, frameset element in the interior
noscript is not defined in the script alternate content when performing
ol define an ordered list
ul unordered list defines
p tag defines paragraph
pre defined preformatted text
table tag defines an HTML table
tbody tag table (body) of the main
criteria in the table cell td
tfoot page definition table foot (or Notes to table footnote)
TH defined header cell
thead label definition table header
tr define rows of the table

Inline elements What?

define a tag anchor
abbr shows an abbreviated form of
acronym definitions take only Acronym
b bold font
bdo can override the default text direction
big large bold font
br wrap
cite references defined
code defining computer code text
dfn define a project defined
em is defined as the emphasis in the
i italic text effects
img embedding an image to a page
input input box
kbd keyboard defined text
label tag for the element which defines the label (tag) input
Q defined short-rEFERENCE
samp define the sample text
select or create a radio option menu
small> small font rendering effect
within the span of a combination of document row elements
strong tone stronger emphasis in the
sub-defined text subscript
sup> defined superscript text
textarea multi-line text input control
tt typewriter or monospaced text effects
var define the variable

The variable element

Determining the variable element is a block element according Context inline element or elements

Button button
del define the document has been deleted text
iframe created containing inline frames another document (i.e. inline frame)
INS label definitions have been inserted into a text document
map client-side image map (i.e., the hot zone)
Object Object Object

Note: The block elements can contain inline elements and block-level elements. Inline elements can not contain block-level elements.

Guess you like

Origin blog.51cto.com/14568129/2442898