Im stuck in creating the following menu. Cant get it to center. Seems like img
inside span
is breaking the display.
DESIRED RESULT:
HTML:
<ul id="rounded-cats" class="cleardiv">
<li>
<a href="#">
<span>
<img src="http://placehold.it/70" height="70" />
</span>
<strong>
Category name
</strong>
</a>
</li>
<li>
<a href="#">
<span>
<img src="http://placehold.it/70" height="70" />
</span>
<strong>
Category name
</strong>
</a>
</li>
<li>
<a href="#">
<span>
<img src="http://placehold.it/70" height="70" />
</span>
<strong>
Category name
</strong>
</a>
</li>
<li>
<a href="#">
<span>
<img src="http://placehold.it/70" height="70" />
</span>
<strong>
Category name
</strong>
</a>
</li>
<li>
<a href="#">
<span>
<img src="http://placehold.it/70" height="70" />
</span>
<strong>
Category name
</strong>
</a>
</li>
<li>
<a href="#">
<span>
<img src="http://placehold.it/70" height="70" />
</span>
<strong>
Category name
</strong>
</a>
</li>
<li>
<a href="#">
<span>
<img src="http://placehold.it/70" height="70" />
</span>
<strong>
Category name
</strong>
</a>
</li>
</ul>
CSS:
#rounded-cats {
text-align: center;
//display: table;
border: 1px solid red;
width: 100%
}
#rounded-cats li {
//margin-bottom: 20px;
//height: 190px;
display: inline;
}
#rounded-cats span {
background: #c7c7c7;
width: 112px;
height: 112px;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
text-align: center;
display: block;
vertical-align:middle;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#rounded-cats span img {
display: inline !important
}
#rounded-cats a:hover span {
background: #7c6eb0
}
#rounded-cats a:hover {
color: #7c6eb0
}
#rounded-cats img {
margin: auto;
display: block;
}
JSFIDDLE: http://jsfiddle.net/gtux2snu/