Home > front end >  Empty inline - block has occupied the position o great god answers
Empty inline - block has occupied the position o great god answers

Time:12-07




<meta charset="UTF-8">
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
Document
<style>

Div {
Background - color: red;
}
Span# test {
background-color: blue;
display: inline-block;
The line - height: 0 px;
}
</style>

<body>
12312312 & lt;/div>

12312312 & lt;/div>



Nothing but occupy a position in clear span

CodePudding user response:

What is the purpose of you? Fluctuation is div, default is accounted for the entire line, you again set span line height is 0, it is useless, don't want it to display Settings display: none, want to let it show, that is about to reposition the div below, don't let it layout in sequence, actually should first clear purpose

CodePudding user response:

The line - height: 0 is someone let I try not to get rid of, I'm sorry, but I wanted to know the inline - block is empty but occupies a position clearly is very strange, not involving the specific implementation,

CodePudding user response:

The inline and inline - block has a default margin, about 3 px

CodePudding user response:

After the experiment do not exist, and if you remove the CSS set the inline - block after the middle spacing is,

CodePudding user response:

 
12312312 & lt;/div>
12312312 & lt;/div>

Write a try, do not have Spaces and newlines,
What do you want to achieve, no special demand, need not the inline - block;
  • Related