I have a span
similar to this:
<span class="indicator"></span>
Sometimes this span
contains numbers like:
<span class="indicator">
<span>10</span>
</span>
Other times it may display Kendo-UI icons, such as:
<span class="indicator">
<span class="k-font-icon k-i-checkmark"></span>
</span>
Below is the CSS associated with these elements:
span.indicator {
position: relative;
border: 1px solid #8a8a8a;
background: #8a8a8a;
color: #ffffff;
font-size: 0.85em;
font-family: helvetica;
padding: 2px;
margin: 2px;
width: 30px;
overflow: visible;
text-decoration: none;
text-align: center;
display: inline-block;
border-radius: 4px;
}
.k-font-icon {
font-family: KendoUIGlyphs;
speak: none;
font-style: normal;
font-weight: 400;
font-variant: normal;
text-transform: none;
font-size: 1.3em;
line-height: 1;
opacity: 1;
text-indent: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-image: none;
font-size: 16px;
}
There are two issues that need addressing:
- I want the height of both
span
indicators to be consistent. Currently, the one with an icon is slightly taller than the other. - The icon within the
span
with an icon is not vertically centered.
UPDATE:
Adjusting the font-size
of .k-font-icon
to 1em
resolves both problems, but makes the icon appear too small.
UPDATE 2:
For a demonstration, refer to the Kendo UI Dojo.