Code:
<html>
<head>
<style>
#ex {
width: 700px;
background: red;
float: left;
}
a, span {
display: block;
}
ul, li {
margin: 0;
padding: 0;
}
.ex_1 {
float: left;
background: yellow;
list-style: none;
}
.ex_2 {
float: right;
}
</style>
</head>
<body>
<div id="ex">
<ul class="ex_1">
<li class="ex_2"><a href="#"><span>example 1</span></a></li>
<li class="ex_2"><a href="#"><span>example 2 - </span></a></li>
<li class="ex_2"><a href="#"><span>example 3 - </span></a></li>
<li class="ex_2"><a href="#"><span>example 4 - </span></a></li>
</ul>
</div>
</body>
</html>
because <a> and <span> are default display:block, so i can't set display:inline for <li>.
NOTE : only use CSS, not JAVASCRIPT.
Please help me !!!
Comment