Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You could use generated content for the dots... (I learned this from <a href="https://stackoverflow.com/questions/17312503/how-to-style-in-css-product-price">this post</a>)</p> <blockquote> <p>We create the dot leaders with a ‘:before’ pseudo-element attached to the LI elements. The pseudo-element fills the whole width of the list item with dots and the SPANs are put on top. A white background on the SPANs hides the dots behind them and an ‘overflow: hidden’ on the UL ensures the dots do not extend outside the list: (from <a href="http://www.w3.org/Style/Examples/007/leaders.en.html" rel="nofollow noreferrer">this w3.org article</a>)</p> </blockquote> <p><strong>EDIT:</strong> Updated code to allow for nested lists</p> <p><strong><a href="http://jsfiddle.net/danield770/WTnma/3/" rel="nofollow noreferrer">FIDDLE</a></strong></p> <h2>Markup</h2> <pre><code>&lt;ul class="outer"&gt; &lt;li&gt;&lt;a href="#"&gt;Introduction&lt;/a&gt;&lt;span&gt;1&lt;/span&gt;&lt;/li&gt; &lt;li class="nested"&gt; &lt;ul class="inner"&gt; &lt;li&gt;&lt;a href="#"&gt;Header 1&lt;/a&gt;&lt;span&gt;2&lt;/span&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Header 2&lt;/a&gt;&lt;span&gt;2&lt;/span&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Header 2&lt;/a&gt;&lt;span&gt;3&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <h2>CSS</h2> <pre><code>ul { list-style: none; padding: 0; overflow-x: hidden; } .outer { width: 70%; } .inner { padding-left: 20px; } li:not(.nested):before { float: left; width: 0; white-space: nowrap; content:". . . . . . . . . . . . . . . . . . . . "". . . . . . . . . . . . . . . . . . . . "". . . . . . . . . . . . . . . . . . . . "". . . . . . . . . . . . . . . . . . . . " } li a:first-child { padding-right: 0.33em; background: white } a + span { float: right; padding-left: 0.33em; background: white } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload