Why text indent in <a>
works only with display:block? When I leave it inline, text indentation doesn't work
Asked
Active
Viewed 142 times
-4

Catalin MUNTEANU
- 5,618
- 2
- 35
- 43

Mindaugo
- 87
- 5
-
3Um, because that's what the spec says it should do? http://www.w3.org/TR/CSS2/text.html#indentation-prop – j08691 Mar 20 '15 at 15:23
-
Certain CSS properties don't work with inline elements. `` is an inline element. When you set to block, it's not inline anymore – Rob Scott Mar 20 '15 at 15:23
-
Possible duplicate - http://stackoverflow.com/questions/7723468/text-indent-9999-for-image-replace-not-working – Paulie_D Mar 20 '15 at 15:23
-
@j08691 you crack me up. just as sarcastic as I am haha – Rob Scott Mar 20 '15 at 15:24
1 Answers
2
text-indent
only works on block level elements, not on inline elements.
Instead use display: inline-block
or padding-left
on the anchor.

GreyRoofPigeon
- 17,833
- 4
- 36
- 59