<LI>
width 要素を彼の一番左の子 (3 つの子のうち) で埋める必要があります。これらの 3 つの子は でフォーマットされdisplay: inline-block; float: right
ます。
私がこれまでに達成したこと:
私が達成することを期待したもの:
width: 66%
とにかく役に立たないことは明らかです。また、100% の幅は機能しません。
この質問はstackoverflowで見つけましたが、純粋なCSSで作成されたものが必要で、JS、jQueryなどは必要ありません。また、テーブルを使用することは私にとって解決策ではありません。
HTML コードがこの問題に役立つ場合:
<style type="text/css">
div {
width: 200px;
border: 1px solid red;
}
ul {
padding: 0px 0px 0px 20px;
margin: 0px;
}
li {
display: block;
white-space: nowrap;
list-style-type: none;
display: block;
height: 20px;
padding: 0px;
margin: 1px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border-color: #D5AB55 #C93 #C93 #D5AB55;
background-color: #F3CE00;
}
.name {
display: inline-block;
float: right;
height: 18px;
width: 65%;
margin: 0px;
padding: 0px 2px;
border: 1px solid grey;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.save, .cancel {
display: inline-block;
float: right;
height: 20px;
width: 20px;
margin: 0px 0px 0px 1px;
padding: 0px;
border: 1px solid grey;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.save { background: url(../images/confirm.png) no-repeat center center; }
.cancel { background: url(../images/cancel.png) no-repeat center center; }
</style>
<div>
<ul>
<li>
<input type="button" value="" class="cancel">
<input type="button" value="" class="save">
<input type="text" value="Big list item" class="name">
</li>
<ul>
<li id="category_2" id_category="2">
<input type="button" value="" class="cancel">
<input type="button" value="" class="save">
<input type="text" value="Medium list item" class="name">
</li>
<ul>
<li>
<input type="button" value="" class="cancel">
<input type="button" value="" class="save">
<input type="text" value="1st small item" class="name">
</li>
<li>
<input type="button" value="" class="cancel">
<input type="button" value="" class="save">
<input type="text" value="2nd small item" class="name">
</li>
<li>
<input type="button" value="" class="cancel">
<input type="button" value="" class="save">
<input type="text" value="3rd small item" class="name">
</li>
</ul>
</ul>
</ul>
</div>
御時間ありがとうございます、
シンクロ、