Don’t set styles on elements that are specific to their use on only some parts of the page. It is highly unlikely you want all <a>
elements to have margin-right: 10px;
.
Styles set on elements should be universal, something you know you want on all instances of the elements everywhere. They can be given styles using classes specific to their use.
You can give .word-icon
some negative margin-left to pull the span and icon closer together. But I would suggest this.
/* distribute horizontal space and make the icons wrap */
.social-icons {
margin-top: 3rem;
display: flex;
justify-content: space-evenly;
flex-wrap: wrap;
}
/* make the span and icon sit right next to each other, align vertically if needed */
.social-icon {
font-size: 2rem;
margin: 1rem;
display: flex;
align-items: center;
}
/* push the span and icon away from each other again by whatever amount you want */
.word-icon {
margin-left: 8px;
}