The difference between "CSS3" block-level elements and inline elements

Source: Internet
Author: User

First, the three differences between the inline element and the block-level function

Features of inline elements:

    • And the other elements are on one line;
    • Height, row height and margin and inner margin part can be changed;
    • The width is only relevant to the content;
    • Inline elements can only hold text or other inline elements.
    • The inline element setting width is invalid, the height is invalid (can be set line-height), margin is invalid, padding up and down invalid


Block-level elements

    • Always start on a new line and occupy a whole line;
    • Height, row height, margin and inner margin can be controlled;
    • Broadband is always the same as the browser width, regardless of content;
    • It can accommodate inline elements and other block elements.


Second, in-line elements are converted to block-level elements

Display:block (the literal representation is set to block level)

Three, inline elements and block-level elements

block-level element list
<address> Define Address
<caption> Defining table Headings
<dd> Defining entries in the definition list
<div> Define a partition or section in a document
<dl> Definition List
<dt> Define items in a list
<fieldset> Defining a Frameset
<form> Create an HTML form
Define the largest title
Define Subtitle
Defining headings
Defining headings
Defining headings
Define the smallest title
Create a horizontal line
<legend> element defines a caption for the fieldset element
<li> Label Definition list items
<noframes> Display text for browsers that do not support frames, inside the frameset element
<noscript> Define alternative content when the script is not executed
<ol> Defining an ordered list
<ul> Defining unordered Lists
<p> Label definition Paragraph
<pre> To define a pre-formatted text
<table> Label Definition HTML Table
<tbody> Label table body (body)
<td> Standard cells in a table
<tfoot> Define a footer for a table (footnote or table note)
<th> Define table header Cells
<thead> Table header for Label definition table
<tr> Define rows in a table
in-line element list
<a> Tags can define anchors
<abbr> Represents an abbreviated form
<acronym> Define to take initials only
<b> Font Bold
<bdo> can override the default text orientation
<big> Large font Bold
<br> Line break
<cite> References are defined
<code> Defining computer code Text
<dfn> Define a definition Project
<em> What is defined as an emphasis
<i> Italic text Effect
Embed an image into a Web page
<input> Input box
<kbd> Defining keyboard text
<label> Label defines the callout (tag) for the INPUT element
<q> Define a short reference
<samp> Define sample text
<select> Create a single or multi-select menu
<small> Renders a small font effect
<span> Inline elements in a composite document
<strong> A stronger emphasis on the content of the tone
<sub> Define subscript text
<sup> Defining superscript text
<textarea> Multiple lines of text input controls
<tt> Typewriter or equal-width text effect
<var> Defining variables

variable element list--variable element to determine whether the element is a block element or an inline element based on context contexts
<button> Button
<del> Define text that has been deleted in the document
<iframe> Create an inline frame that contains another document (inline frame)
<ins> Label defines the text that has been inserted into the document
<map> Client image mapping (i.e. hot zone)
<object> Object objects
<script> Client Script

The difference between "CSS3" block-level elements and inline elements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.