Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bullets disappear with CSS3 columns

Tags:

css

html-lists

The bullets on my list items disappear when I convert them to columns using CSS3. Any ideas why or suggestions on how to correct it?

See the example: http://jsfiddle.net/gduDm/1/

ul li {     list-style-type: disc !important;     column-break-inside: avoid; } ul {     list-style-type: disc !important;     margin-top: 1em;     column-count: 2;     column-gap: 0.5em; } 
like image 792
Andrew Avatar asked Jun 01 '12 18:06

Andrew


People also ask

How do I make bullet points disappear in CSS?

Adding the "list-style: none" CSS class to the unordered list (<ul>) or ordered list (<ol>) tag removes any bullet or number.

How do I put bullets in CSS?

To set the bullet appearance you can use CSS' list-style or list-style-type . list-style-type is the exact property we are changing here, but you can also use list-style to change multiple properties, which we will come to shortly. You don't have to remember to set the bullet appearance each time.

Can I use CSS to add a bullet point to any element?

You can use <h1 class="bullet"> with pseudo-element :before .


2 Answers

I think the bullets are there, but they're being rendered to the left of the viewing area. Try:

list-style-position: inside; 
like image 148
rawb Avatar answered Sep 18 '22 08:09

rawb


Adding both padding-left and a negative text-indent to the list elements seems to produce the desired result:

ul li {     padding-left: 1em;     text-indent: -1em; } ul {     list-style: inside disc; } 

http://jsfiddle.net/mblase75/gduDm/4/

Alternatively, add a margin-left to the list element (instead of the list) and use outside bullets:

ul li {     margin-left: 1em; } ul {     list-style: outside disc; } 

http://jsfiddle.net/mblase75/gduDm/9/

like image 32
Blazemonger Avatar answered Sep 18 '22 08:09

Blazemonger