html - CSS styling a table of contents -


i'm trying replicate following table of contents:

i've gotten pretty close following code: http://jsfiddle.net/33kgn/2/

.list li {     position:relative;     overflow:hidden;     width:330px; }  .list li:after {     font-family: times new roman;     font-size: 120%;     content:".................";     text-indent: -1px;     display:block;     letter-spacing:34px;     position:absolute;     left:0px;     bottom:0px;     z-index:-1;     font-weight:bold; } .list li span {     display:inline-block;     background-color:#fff;     padding-right:5px; }  .list li .number {     float:right;     font-weight:bold;     padding-left:5px; }  <div style="margin:25px 22px 200px 22px;">  <div style="text-align:center;font-size:150%;letter-spacing:.1em;margin-bottom:10px;margin-right:-.1em;">contents</div>   <ul class="list" style="padding-left:180px;">    <li style="margin:0 0 .6em 0;"><span>editor&rsquo;s introduction</span><span class="number">ix</span></li>    <li style="margin:0 0 .5em 0;"><span style="padding-left:.6em;">1. historical</span><span class="number">ix</span></li>     <li style="margin:0 0 .5em 0;"><span style="padding-left:.6em;">2. epistemology</span><span class="number">xii</span></li>    <li style="margin:0 0 .5em 0;"><span style="padding-left:.6em;">3. epistemology of morals</span><span class="number">xx</span></li>    <li style="margin:0 0 .5em 0;"><span style="padding-left:.6em;">4. psychology of morals</span><span class="number">xxvi</span></li>    <li style="margin:0 0 .5em 0;"><span style="padding-left:.6em;">5. moral system</span><span class="number">xxx</span></li>    <li style="margin:0 0 1.5em 0;"><span style="padding-left:.6em;">6. morals , theology</span><span class="number">xliii</span></li>    <li style="margin:0 0 .5em 0;"><span>a review of principal questions in morals</span><span class="number">1</span></li>    <li style="margin:0 0 .5em 0;"><span>index</span><span class="number">297</span></li>   </div>  </div> 

but can see if follow link, "a review..." , "index" part doesn't work. appreciated.

edited add: difficulty here lies in indentation , line-wrapping of "a review of principal questions in morals". question not yet have answer.

here jsbin

use display: inline; instead of display: inline-block;

in list li span{...} css class

list li span {     display: inline;     background-color: rgb(255, 255, 255);     padding-right: 5px; } 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -