Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically add &raquo; (») to <li> elements using CSS?

Tags:

html

css

list

I want to automatically add the HTML character &raquo; (») to the left of each li element.

What would be the best practise?

I want the HTML to be:

<ul>   <li>item 1</li>   <li>item 2</li>   <li>item 3</li> </ul> 

And it should display:

» item 1 » item 2 » item 3 
like image 472
Brad Avatar asked Jul 20 '09 18:07

Brad


People also ask

How do you automatically add in Excel?

Select a cell next to the numbers you want to sum, click AutoSum on the Home tab, press Enter, and you're done. When you click AutoSum, Excel automatically enters a formula (that uses the SUM function) to sum the numbers.

How do you automatically add names in Excel?

Put the mouse pointer over the bottom right-hand corner of the cell until it's a black plus sign. Click and hold the left mouse button, and drag the plus sign over the cells you want to fill. And the series is filled in for you automatically using the AutoFill feature.


1 Answers

I found the above answer didn't work for me, but the following does:

li:before{    content: "\00BB"; } 

This uses the hexadecimal code for &raquo instead.

A nice hexadecimal converter can be found here.

Hope this helps someone :)

like image 136
brendo Avatar answered Oct 01 '22 08:10

brendo