Home > Article > Web Front-end > Discuss in detail the difference between display:inline style and span in div
This article mainly talks about the difference between display:inline style and span in div. Friends who are interested can learn more about it together!
The code is as follows:
<span style="background-color:red;">xxx</span> <span style="background-color:red;">xxx</span> <div style="background-color:red;display:inline">xxx</div> <div style="background-color:red;display:inline">xxx</div> <span style="background-color:red;">我是没有间隔的</span><span style="background-color:red;">伟大的hutia,挖哈哈哈</span>
Summary:
In one sentence, you specify the inline-block attribute for an object through display:inline-block in CSS , the object can be rendered as an inline object, but the object's contents are rendered as a block object.
Related recommendations:
What is the difference between div and span
In HTML web page layout, div and span What is the difference between span
How jquery implements the keydown event of div and span in detail
#Details about div and span html block-level elements in html5 Introduction
What is the difference between div and span? Analysis and explanation
The above is the detailed content of Discuss in detail the difference between display:inline style and span in div. For more information, please follow other related articles on the PHP Chinese website!