Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spacing between font awesome icons [duplicate]

Tags:

html

css

I want to erase the annoying spacing between fa icons(with background) in this jsfiddle.

I tried margin and word-spacing but it didn't work.

CSS of the icons container :

.home-header-sm {
  text-align: right;
  margin-right: 20px;
  font-size: 20px;
  word-spacing: 0px;
}

.home-header-sm a,
.home-header-sm a:visited,
.home-header-sm a:hover,
.home-header-sm a:active {
  color: #FFFFFF;
}

.fa {
  text-align: center;
  border-style: solid;
  background-color: #ffffff;
  color: #1D233D;
  width: 30px;
  padding-top: 3px;
  padding-bottom: 3px;
  margin: 0px 0px 0px 0px !important;
}
like image 217
Pro Haitham Avatar asked Dec 29 '25 08:12

Pro Haitham


2 Answers

You have two issues.

1) Your icons have a border around them. Remove it with:

.fa { border: none; }

2) Second, remove the whitespace between the tags in the html.

like image 185
Michael Arrison Avatar answered Jan 01 '26 03:01

Michael Arrison


You can remove the border, float the icons to the left, and float the holding container to the right:

https://jsfiddle.net/ww1nescm/1/

.fa {
  border-width: 0;
  float: left;
}

.home-header-sm {
  float: right;
  width: auto;
}
like image 26
Frits Avatar answered Jan 01 '26 02:01

Frits



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!