In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what are the differences between SPAN elements and DIV elements, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The most obvious difference is that DIV is a block element and SPAN is an embedded element. Block elements are commensurate with embedded elements by adding one before and after each.
Change the line. In fact, block elements and inline elements are not intact. Just define display:inline for block elements, and block elements become embedded elements. Similarly, defining display:block for embedded elements becomes block elements.
The difference between and
Span element:
Allows the web page maker to give a stylesheet without adding it to the HTML element, that is, span is independent of HTML meta-meat. Span is used as a local identifier in the stylesheet, and also accepts styleclass and ID attributes such as.
Span is an inline element that is pure to take advantage of the appearance of the style.
DIV element:
On the basis of taking span similar, maybe Dao has all the functions of SPAN, in addition, it also has the characteristics that SPAN is inferior to. DIV is a block, that is, the so-called "container", which has its own independent paragraph drop, independent title, independent table, such as. It contains everything as well.
Code example:
Div,span {border:1pxsolid#000;margin:2} div1div2 span1span2
Div3 div4 span3 span4
Skills:
Some friends will say that DIV is a layer tag, in fact, there is no layer in HTML, just to make it easy to understand, it is written in Dreamweaver, every elephant can become a "layer", as long as the object is defined with a position attribute (the value is absolute or relavite). For example, to make a picture a "layer", you can write code like this:
Special reminder
The running consequence of the original code is shown in figure 2.1.6.3. In order to better clarify the answer, both the block element and the embedded element are added a wide black line frame, which can be seen from the figure. DIV defaults to the block element. The display attribute value is defined as inline after the embedded element is displayed, while SPAN defaults to the embedded element. After defining the display attribute value as block, it is displayed as a block element.
The above is all the content of the article "what is the difference between SPAN element and DIV element". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.