deltaskelta deltaskelta - 4 months ago 8
HTML Question

How to structure this HTML to center stuff in a div

Sometimes when I come back to html I forget the simple things...

I want to be able to get the spans inside the div to center. IDK if I have it structured right, feel free to suggest anything

https://jsfiddle.net/yxg1zsac/



.define_link {
background: rgba(0,0,0,.3);
border-radius: 10px;
padding: 5px;
width: 200px;
margin: 5px auto;
font-size: 20px;
display: inline-block;
font-weight: bold;
text-align: center;
}

.pagination {
width:100%;
margin:auto
}

<div class="pagination">
<span class="define_link"><a href="">previous</a></span>
<span class="current">Page 2 of 88.</span>
<span class="define_link"><a href=""></a>next</span>
</div>




Answer

Try this:

https://jsfiddle.net/tobyl/yxg1zsac/1/

Critical CSS:

.pagination {
  text-align: center;
}