I use dt and dd to create a paper form.
dt width should match the word and dl should match remain space
Now I adjust each line manually, how can I use css to auto do this?
div {
width: 200px;
}
/* dl dt dd same line */
dl {
width: 100%;
overflow: hidden;
padding: 0;
margin: 0
}
dt {
float: left;
/* adjust the width; make sure the total of both is 100% */
padding: 0;
}
dd {
float: left;
/* adjust the width; make sure the total of both is 100% */
margin: 0;
box-sizing: border-box;
border-bottom: 1px solid black;
}
dl dt:nth-of-type(1) {
width: 36%;
}
dl dd:nth-of-type(1) {
width: 64%;
}
dl dt:nth-of-type(2) {
width: 26%;
}
dl dd:nth-of-type(2) {
width: 74%;
}
dl dt:nth-of-type(3) {
width: 14%;
}
dl dd:nth-of-type(3) {
width: 86%;
}
<div>
<dl>
<dt>aaabbbccc:</dt>
<dd> </dd>
<dt>aaabbb:</dt>
<dd> </dd>
<dt>aaa:</dt>
<dd> </dd>
</dl>
</div>