0

I'm not a css pro. I want to give margin between icon and text. I tried this way. But results not similar to what i expected.

.user-details i{
  margin: 0 10px 0 -2px;
}

enter image description here

I want same space between icon and text.

Dushan
  • 138
  • 2
  • 13

2 Answers2

2

As I said in the comment, you can add :

.user-details i{
    margin: 0 10px 0 -2px;
    display: inline-block; /* so min-width can be used */
    min-width: [width-of-largest-icon]px;
}

Also, don't forget about inline-block whitespace.

Community
  • 1
  • 1
Vucko
  • 20,555
  • 10
  • 56
  • 107
0

Dushan, when i see your icon list picture, I would like to suggest u try other two methods

:before :after methods

or

background:url(background-icon-image.jpg) -10px 0px no-repeat; The -10px 0px are background-position attributes, which Specifies the position of the background images personally i used this one very often to align icons;

infiniteloop
  • 885
  • 2
  • 12
  • 29