HTML How to Make a Website Adding Pages to a Website Add Iconography

Jonathan Castillo
PRO
Jonathan Castillo
Pro Student 836 Points

Display: block

Hello, I'm having trouble understanding the iconography or maybe am overthinking it but while adding the image to the anchor element why does the image push away from the text when you add padding to te left but when I add padding to the right nothing happens.

2 Answers

Hi Jonathan

The icons are background images in the anchor tag and not in line with the text. So when he adds 30px padding to the left of the anchor tag, he's not adding the padding to the background image. This means the text will be pushed over 30px to the right. But the background image is not affected because it's in the background of the anchor tag.

I hope this makes sense.

Siddharth Nasare
Siddharth Nasare
15,636 Points

If you are giving display: block property, then you won't have an access to padding or margin property. You neet to use display: inline-block property for that. Then you will allow using margin and padding. Try it!!!