


What are inline elements and block-level elements? _html/css_WEB-ITnose
1. What are inline elements and block-level elements?
Block-level elements
information on author | |||||||||||||||||
long quotation | |||||||||||||||||
push button | |||||||||||||||||
table caption | |||||||||||||||||
definition description | |||||||||||||||||
deleted text | |||||||||||||||||
generic language/style container | |||||||||||||||||
definition list | |||||||||||||||||
definition term | |||||||||||||||||
form control group | |||||||||||||||||
interactive form | |||||||||||||||||
heading | |||||||||||||||||
heading | |||||||||||||||||
heading | |||||||||||||||||
heading | |||||||||||||||||
heading | |||||||||||||||||
heading | |||||||||||||||||
horizontal rule | |||||||||||||||||
inline subwindow | |||||||||||||||||
inserted text | |||||||||||||||||
fieldset legend | |||||||||||||||||
list item | |||||||||||||||||
client-side image map | |||||||||||||||||
alternate content container for non frame-based rendering | |||||||||||||||||
alternate content container for non script-based rendering | |||||||||||||||||
generic embedded object | |||||||||||||||||
ordered list | |||||||||||||||||
paragraph | |||||||||||||||||
preformatted text | |||||||||||||||||
Inline elements 2. What is the difference between inline elements and block-level elements? 1.Size - an important difference between block-level elements and inline elements inline elements and width The W3C CSS2 standard stipulates that the width attribute will not be applied to inline elements and non-replacement elements. In the following example, width:200px is applied to the inline element . As you can see, it has no effect at all. Inline elements and height The W3C CSS2 standard stipulates that the height attribute will not be applied to inline elements and non-replacement elements, but the box height can be passed through line -height to specify. In the following example, height:50px is applied to the inline element . You can see that there is no effect. Inline elements and padding You can set padding for inline elements, but only padding-left and padding-right take effect. In the following example, the inline element has padding:50px applied. You can see that it affects the left and right content, but not the top and bottom. Inline elements and margin The margin attribute is the same as the padding attribute. It is valid for the left and right of inline elements, but not for the top and bottom. In the example below, margin:50px is applied to . You can see that the left and right edges are effective but the top and bottom content are not. Remember that setting width for inline elements has no effect. The above part is translated from: http://www.maxdesign.com.au/ presentation/inline/
2. The text-align attribute is the difference between the two expressions in the W3C CSS2.1 specification Section 16.2 describes text-align in detail: If the inline content within the center-aligned child element does not need to be center-aligned, you also need to set "text-align:left" for it:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
![]() Hot AI Tools![]() Undresser.AI UndressAI-powered app for creating realistic nude photos ![]() AI Clothes RemoverOnline AI tool for removing clothes from photos. ![]() Undress AI ToolUndress images for free ![]() Clothoff.ioAI clothes remover ![]() Video Face SwapSwap faces in any video effortlessly with our completely free AI face swap tool! ![]() Hot Article
How to fix KB5055523 fails to install in Windows 11?
3 weeks ago
By DDD
How to fix KB5055518 fails to install in Windows 10?
3 weeks ago
By DDD
Strength Levels for Every Enemy & Monster in R.E.P.O.
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Roblox: Dead Rails - How To Tame Wolves
3 weeks ago
By DDD
Blue Prince: How To Get To The Basement
3 weeks ago
By DDD
![]() Hot Tools![]() Notepad++7.3.1Easy-to-use and free code editor ![]() SublimeText3 Chinese versionChinese version, very easy to use ![]() Zend Studio 13.0.1Powerful PHP integrated development environment ![]() Dreamweaver CS6Visual web development tools ![]() SublimeText3 Mac versionGod-level code editing software (SublimeText3) ![]() Hot Topics
Java Tutorial
![]() ![]()
CakePHP Tutorial
![]() ![]()
Laravel Tutorial
![]() ![]()
PHP Tutorial
![]() ![]()
C# Tutorial
![]() ![]() ![]() HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process. ![]() WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences. ![]() HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website. ![]() GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee... ![]() AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM. ![]() To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding... ![]() HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations. ![]() The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations... ![]() |