I must be doing some basic thing wrong since I don't want the space between each letters below.
HTML:
<i class="icon icon1"></i>
<i class="icon icon2"></i>
<i class="icon icon3"></i>
CSS:
.icon {
display: inline-block;
position: relative;
padding: 3px;
background: yellow;
margin: 0;
}
.icon1:before {
content: "A";
}
.icon2:before {
content: "B";
}
.icon3:before {
content: "C";
}
Link: http://jsfiddle.net/qhoc/rkRBY/
I believe the space is automatically there between each character unless font-size:0
. My requirements are:
<i>
to something else. I am using Bootstrap by the way.Let me know if there is workaround! Thanks.
There are two good ways afaik,
display: table-cell
to that element.Try this:
.icon {
display: table-cell;
/* removed padding: 3px; */
position: relative;
background: yellow;
margin: 0px;
}
.icon1:before {
content: "A";
}
.icon2:before {
content: "B";
}
.icon3:before {
content: "C";
}