tags:

views:

127

answers:

2
<html>
<head>
<style type="text/css">
.ex1 {background:red; float:left; margin:0; padding:0;}
.ex1 li {list-style-type: none;  margin:0; padding:0;  background: grey; float:right}
.clear {clear:both}
</style>
</head>
<body>

<div style="background: yellow; width:750px">
<ul class="ex1">
<li>Some text. Right-to-left 1.</li>
<li>Some text. Right-to-left 2.</li>
<li>Some text. Right-to-left 3.</li>
<div class="clear"></div>
</ul>
<div class="clear"></div>
</div>

</body>
</html>

Please help me !

IN IE7 when 'ul' float: left and 'li' float:left, the width of 'ul' is ok. but when 'ul' float:left and 'li' float: right, the width of 'ul' is 100%. What should i do to make the width of ul when 'li' float:right is look like 'li' float:left. i can't set width of ul because it's must depends of 'li'. width of 'ul' = total width of 'li'.

A: 

thanks for your answer, but i'm wrong when writing code.... it's mus be :

  • Some text. Right-to-left 1.
  • in that : tag 'a' and 'span' are display:block; it's default. So i can't set display:inline or inline-block for 'li'.

    salem