What’s the difference between inline and inline-block?

What’s the difference between inline and inline-block?

Senior Developer Asked on June 5, 2018 in CSS.
Add Comment
1 Answer(s)

 

<h1> inline element and inline-block</h1>

<div class="example">

Lorem ipsum dolor sit amet<br/>

consectetur adipiscing elit<br/>

</div>

<div>

This is <span class="demo">inline Element</span> Example.<br/>

sed do eiusmod tempor incididunt<br/>
</div>
<style>

h1 { font-size: 20px; font-weight: bold; }

.example { border: solid 1px #c0c0c0; padding: 8px; margin: 12px; background-color: #f0f0e9; width: 70% }

.demo { display: inline; height: 100px; border: dotted 1px red; background-color: white; }
</style>

 

inline

 

Default Answered on November 25, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.