Reputation: 2169
this is my blog main page http://lowcoupling.com/ it is a tumblr blog based on Twitter bootstrap. I am trying to have the badges in the footer representing the main topics more separated vertically in this way:
<span style="margin-left:2px; margin-top:5px;"> <a href="http://lowcoupling.com/tagged/UML/chrono"><span class="label label-default">UML</span> </a></span>
the problem is that the left margin works but the top margin doesn't.
Upvotes: 4
Views: 17413
Reputation: 4472
<span class="label label-default">UML</span>
<span class="label label-default">CSS</span>
You can use space instead of
but using
is recommended
as it will not be trimmed.
Use line-height
as the span will be treated as text. When the text is wrapped, you cannot use margin which apply to block.
<span class="label label-default" style="line-height: 30px;">UML</span>
Upvotes: 3
Reputation: 2904
You have:
<span style="margin-left:2px; margin-top:5px;">
<a href="http://lowcoupling.com/tagged/UML/chrono">
<span class="label label-default">UML</span>
</a>
</span>
You should have:
<a href="http://lowcoupling.com/tagged/UML/chrono">
<span style="margin-left:2px; margin-top:5px;"></span>
</a>
Upvotes: 0
Reputation: 6655
Use display: inline-block
on parent span and then give margin top or bottom.
<span style="margin-left:2px; margin-top:5px; display: inline-block"> <a href="http://lowcoupling.com/tagged/UML/chrono"><span class="label label-default">UML</span> </a></span>
Upvotes: 1
Reputation: 6795
you need to set display:block;
and float them to left. it is better that you create a class like this:
HTML:
<span class="footer-link">
<a href="http://lowcoupling.com/tagged/UML/chrono">
<span class="label label-default">UML</span>
</a>
</span>
CSS:
span.footer-link{
display:block;
float:left;
margin:5px 0 0 2px;
}
Upvotes: 5
Reputation: 7083
Vertical margins are ignored on inline elements.
See: Margin top in inline element
Lookup the meaning of inline
elements and block
elements in HTML.
Furthermore I recommend that you simply have a look at the StackOverflow's implementation of your so-called 'badges'
Upvotes: 0