CSS style for leading dots

六月ゝ 毕业季﹏ 提交于 2019-12-05 08:17:51

I know you were looking for a CSS solution, but just for fun, I created a JavaScript version of this. (I don't know if it's possible to avoid the cut dots using pure CSS.)

$("a").each(function(){
    var rowHeight = $(this).height();
    while ($(this).height() === rowHeight) {
        $(this).append(" .");
    }
    $(this).html($(this).html().slice(0,-2));
});

FIDDLE: http://jsfiddle.net/9MJsz/

SW4

Its not exactly the same as what you're currently doing, but you could simply have each item in a div element with border-bottom:1px dotted #000;.

Alternatively, take a look here for a similar thread, and relevant CSS answer

While this may not be ideal, you could try 2 things to get rid of (or lessen) the "cut" dots and bad appearance. First, reduce the size of the dots. The smaller the dots the less likely and less noticeable the issue is. Second, put a space after the chapter name. This would prevent 2 dots from being really close like you showed in your screenshot.

Reducing the size of the dots might also aid in showing the difference between the dots at the end of chapter names and the leading dots.

Obviously, this is not an ideal solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!