Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the in-line elements and block-level elements in web development

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail what are the elements and block-level elements in web development. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

What are the common block-level elements:

Button,div, dl, dt, form, H2, h3, h4, h5, h6, hr, li, ul, table series, button

2. What are the common in-line elements:

Img, a, input, textarea, b, br, span, select, label, map, strong

Third, what are the characteristics of the elements in the line:

(1)。 Invalid setting width

(2) setting height is not valid, but you can set line-height

(3) margin is only valid on the left and right, but not on the top and bottom.

(4) like margin, padding is only effective on the left and right, and it is not valid up and down, but the difference is that the range of the element increases, but it has no effect on the surrounding elements.

4. Text-align is different between inline elements and block-level elements in different browsers:

In IE6/7 and IE8 hybrid mode, text- align:center aligns block-level elements as well. In other browsers, text-align:center works only on inline content.

A better way to solve this problem is to set "margin-left:auto; margin-right:auto" for all block-level elements that need to be centered relative to the parent container. However, this method is not supported in IE6/IE7/IE8 's promiscuous mode, so set the "text-align:center;" of the parent container.

This is the end of this article on "what are the elements and block-level elements in web development?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report