Add vertical-align: middle; to ins:
ins {
display:inline-block;
height:50px;
width:50px;
background:blue;
vertical-align: middle;
}
Question
I have the following code:
HTML
<a href="#">
text
<ins></ins>
</a>
CSS
a {
display:inline-block;
height:50px;
//vertical-align: middle; (does not change anything...)
}
ins {
display:inline-block;
height:50px;
width:50px;
background:blue;
}
Now, it looks like this:
But it should look like this:
How can I achieve this desired vertical alignment of the text?
Solution
Add vertical-align: middle; to ins:
ins {
display:inline-block;
height:50px;
width:50px;
background:blue;
vertical-align: middle;
}
OTHER TIPS
Get your text in a <span>
and style like that
<a href="#">
<span>text</span>
<ins></ins>
</a>
span{
float:left;
margin-top:15px;
margin-right:5px;
}
a {
display:inline-block;
height:50px;
}
ins {
display:inline-block;
height:50px;
width:50px;
background:blue;
}