Is it possible to target element that is before and after text. For example:
<button><i class="icon user"> User</button>
<button>User <i class="icon user"></button>
So basically I would like to be able to assign margin left/right to .icon depending if before or after text.
I tried using pseudo :first-child
, :last-child
, but that does not work.
I know that wrapping text in another container like
<button><span>User</span> <i class="icon user"></button>
will give me access to it, but I'm trying to minimize html markup