You should use position: relative
and text-align: center
on the parent element and then display: inline-block
on the child element you want to center. This is a simple CSS design pattern that will work across all major browsers. Here is an example below or check out the CodePen Example.
p {_x000D_
text-align: left;_x000D_
}_x000D_
.container {_x000D_
position: relative;_x000D_
display: block;_x000D_
text-align: center;_x000D_
}_x000D_
/* Style your object */_x000D_
_x000D_
.object {_x000D_
padding: 10px;_x000D_
color: #ffffff;_x000D_
background-color: #556270;_x000D_
}_x000D_
.centerthis {_x000D_
display: inline-block;_x000D_
}
_x000D_
<div class="container">_x000D_
_x000D_
<p>Aeroplanigera Mi Psychopathologia Subdistinctio Chirographum Intuor Sons Superbiloquentia Os Sors Sesquiseptimus Municipatio Archipresbyteratus O Conclusio Compedagogius An Maius Septentrionarius Plas Inproportionabilit Constantinopolis Particularisticus.</p>_x000D_
_x000D_
<span class="object centerthis">Something Centered</span>_x000D_
_x000D_
<p>Aeroplanigera Mi Psychopathologia Subdistinctio Chirographum Intuor Sons Superbiloquentia Os Sors Sesquiseptimus Municipatio Archipresbyteratus O Conclusio Compedagogius.</p>_x000D_
</div>
_x000D_