Discuss in detail the difference between display:inline style and span in div

墨辰丷
Release: 2018-05-09 17:48:44
Original
1923 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template