Missing <li> circles in div with scroll (overflow:auto;)
So I have div id="main_content"
with scroll (overflow:auto;
) and a list inside it. The problem is, that c开发者_Go百科ircles near lists items are missed! How can I fix it?
#main_content {
height: 620px;
margin-left: 390px;
margin-top: -350px;
overflow: auto;
padding-right: 10px;
position: absolute;
text-align: justify;
width: 620px;
}
#main_content ul li {
display: list-item;
list-style: circle;
}
If you've used a reset stylesheet, or perhaps set margin: 0;
in your css, you'll need to reset the margin-left
value of the ul
or li
element(s), unless you prefer to use list-style-position: inside;
(the other value being, obviously, outside
).
ul li {
list-style-type: circle;
margin-left: 2em;
}
JS Fiddle demo.
Add this:
#main_content ul{list-style-position:inside}
It's working here: http://jsfiddle.net/Skooljester/KVTp9/ So you must've reset your ul
or li
somewhere. If that doesn't work you may want to apply list-style:circle;
to your ul
tag instead of your li
.
精彩评论