Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix list style not showing when using CSS3 columns on Webkit

example here: http://jsfiddle.net/R7GUZ/3/

I'm having a heck of a time getting list-style to work in webkit for a parent OL styled with

-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;

How do I format an ordered list into columns with css3 and still maintain the list-style styling?

           <ol class="text-col2">
                <li>
                    <strong>Can we call you?</strong>
                    <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia.</p>
                </li>

                <li>
                    <strong>Can we call you?</strong>
                    <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia.</p>
                </li>
            </ol>

like image 605
HandiworkNYC.com Avatar asked Sep 10 '12 18:09

HandiworkNYC.com


People also ask

How do you display list items in columns?

We can display a list in n columns format in two ways: Using Float in list. Using column-count in list.

How do you use the list style property?

The list-style property can be applied to <ol>, <ul> or <li> tags. The list-style applies to elements with display: list-item. When using the list-style property, you can provide one or all of the values (list-style-type, list-style-position and list-style-image values) and they can be provided in any order.

Which of the following is not the type of list style?

Which of the following can't be the value of list-style-type? Explanation: list-style-property is used for defining the style of list item marker. Its value can be square, circle, disc or none. For setting list item marker to be bullet we use the value disc.


2 Answers

Adding 20px margin-left to the lis did the trick

ol li {
   list-style: decimal;
   margin-left: 20px
}
like image 70
HandiworkNYC.com Avatar answered Nov 02 '22 04:11

HandiworkNYC.com


It seems the numbers are actually hidden. This can be resolved by using the following property:

OL {
  list-style-position: inside;
}

Note if you have reset the margin and padding properties (like in your example on jsFiddle where CSS have been normalized), you will have to set them to the right values so columns are correctly formatted.

like image 43
Stéphane Avatar answered Nov 02 '22 05:11

Stéphane