S
S
sh1ftyshmifty2015-04-20 14:38:53
css
sh1ftyshmifty, 2015-04-20 14:38:53

How to add an icon to the last element of a dynamic menu?

I'm scratching my head, I can't figure it out.
There is a menu, in it you need to select the last item. I have already selected with a color through :last-child, but I would also like to substitute an icon in front of it.
Through :before will not be put down, because only the text, as far as I understand, fits into the content property. Menu items are added via php, which is why the difficulty arose.
I will be very grateful for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Shabalin, 2015-04-20
@sh1ftyshmifty

:before {
  width: ширина иконки;
  height: высота иконки;
  background: url('путь до иконки') no-repeat;
  content: '';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question