Toniq Toniq - 6 months ago 19
HTML Question

Float div inside spans

I have this code in a fiddle

I would like to know if its possible to make

div
float inside text, like its following text?

.a{
position:relative;
width:100px;
height:40px;
background:red;
}

Answer

use display:inline-block

.a {
  display: inline-block;
  vertical-align: middle;
  width: 100px;
  height: 40px;
  background: red;
}
<span>Pause and play icons will automatically be attached to every mp3 song in text. Like this for example: </span>
<div class="a"></div><span> ut laoreet hendrerit mi. Nam vestibulum viverra diam. Nullam eros ipsum, rutrum ut, ultricies sed, congue sed, est. Pellentesque porttitor. Donec dictum urna eu mi. Maecenas in lorem.</span>

Comments