Jason
Jason

Reputation: 52523

Including the numerals from an <ol> in the CSS background

I feel very noobish asking this, but I can't seem to figure it out... I have a standard <ol> that lists

  1. List item
  2. List item
  3. List item

etc.

In my CSS I would like to include the entire <li> in the background color, for instance (in my very best ASCII representation):

----------------
| 1. List item |  <----- box = solid background color
----------------

but I can only seem to get:

   -------------
1. | List item |
   -------------

Is there some property I'm missing? It's pretty annoying and I would like to fix it. Also, I am going to be coloring these different (odd/even) so just coloring the <ol> won't work, I don't think :\

Thanks for your help!

Upvotes: 2

Views: 310

Answers (3)

user176604
user176604

Reputation:

I don't think you're going to be able to use to get the desired effect. I would recommend, divs, dl, or even a table.

Upvotes: 0

Alconja
Alconja

Reputation: 14873

I think what you're after is:

ol { list-style-position: inside; }

Upvotes: 2

alex
alex

Reputation: 490283

What about setting this in the CSS

ol {
    list-style: inside decimal;
}

The 'inside' is the important bit.

Upvotes: 4

Related Questions