There is no float: center
. Only float: left
and float: right
. You can left-float all of <p>
inside the <li>
and set the width of them to 33.33%
.
To ensure the image is responsive, add the following CSS:
img {
height: auto;
max-width: 100%;
}
Each <li>
represents a row:
<ul>
<li>
<p>text</p>
<p><img src=""></p>
<p>text</p>
</li>
</ul>
Overall CSS rules
img {
width: 100%;
height: auto;
}
ul {
list-style-type: none;
}
ul>li>* {
box-sizing: border-box;
display: block;
float: left;
word-break: break-all;
padding: 0 5px;
width: 33.333%;
}
.text-center {
text-align: center;
}
.full-width {
width: 100%;
}
<ul>
<li>
<p>
Placeholder text here
</p>
<p class="text-center">
<img src="http://placehold.it/300x200" alt="">
</p>
<p>
Placeholder text here
</p>
</li>
<li>
</li>
<li>
<p class="full-width">
Placeholder text here
</p>
</li>
<li>
<p class="full-width">
Placeholder text here
</p>
</li>
<li>
<li>
<p>
Placeholder text here
</p>
<p class="text-center">
<img src="http://placehold.it/300x200" alt="">
</p>
<p>
Placeholder text here
</p>
</li>
</ul>