Previous Message
Next Message

RE: [css-d] list formatting ?s

Sent by Alan K. Gay on 17 October 2002 17:05


Here is some code I use for definition lists that gives me more control
than dl/dt/dd.  A little more trouble to code (spans vs dt/dd).  It's
adaptable to just using the "dt" piece for list items without the "dd"
part by changing the width on span.dt.  If you are willing to hand-code
your "1)", then setting span padding to +X and text-indent to -X will
let you create lists with the numbers hanging out to the left.  You will
have to fiddle to get the correct X value.

<html>
<head>
<style type="text/css">
div.lrow {
  clear: both;
  padding-top: .8em;
  height:1.4em;
  color:#0000C6;
  }
div.lrow span.dt {
  float: left;
  width: 15%;
  text-align: left;
  font-weight:normal;
  padding-left:1em;
  text-indent: -1em;
  font-style:italic;
  }

div.lrow span.dd {
  float: right;
  width:80%;
  text-align: left;
  }
  </style>
</head>
<body>
<div class="lrow">
  <span class="dt">1) This is the term</span><span class="dd">This is
the 
  definition</span></div>
</body>
</html>
Previous Message
Next Message

Message thread: