for text elements that are adjacent to icon elements, the glyph height is not aligned with the icon height. the text elements are styled by CSS with font-size: 20px;
and have consistent width for all their instances.
here's an illustration:
for the above case, the text should have the same height as the icon.
finding a way to make the letters a bit taller to take up the available vertical space, while keeping the font-size
as is. how to do that?
to increase the font-size
a bit, but came to conclusion i'll have to compromise for a smaller icon if I can't increase the letter height, thus the issue.
While there is no perfect line height, a good rule of thumb is to set it at approximately 150% of the font size. Top: When the line height is too tight, it undermines the horizontal reading flow and increases doubling.
You can also place your cursor in the text and press Control+A (Windows) or Command+A (macOS) to select it. Use the Properties panel on the right to change the font, style, and size.
In HTML, you can change the size of text with the <font> tag using the size attribute. The size attribute specifies how large a font will be displayed in either relative or absolute terms. Close the <font> tag with </font> to return to a normal text size.
You can do it with css3 property Scale
: (demo on dabblet.com)
HTML markup:
<span class="lower">lower size</span>
<span>normal size</span>
<span class="taller">taller size</span>
CSS:
span {
font-size: 20px;
display: inline-block;
}
span.lower{ transform: scaleY(0.9); }
span.taller { transform: scaleY(1.1); }
Also, you can try to set various values of vertical-align
for images in your case:
sub
, super
, bottom
, top
, middle
. This may help to solve your problem from another point.
Try adding line-height: 20px;
it will only increase the space between lines. It should help you match the element height.
And considering your calendar icon and text, add vertical-align: middle;
to the image.
Demo: http://jsfiddle.net/rBpKL/3/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With