This is my code:
<html>
<head>
<style>
#wrap{
border: 1px solid black;
width: 500px;
height: 200px;
}
#wrap div{
border: 1px solid red;
width: 100px;
height: 150px;
float: left;
}
.item2{
float: right;
}
</style>
</head>
<body>
<div id="wrap">
<div class="item1"></div>
<div class="item2"></div>
</div>
</body>
<html>
Why my div item 2 did not flow right?Anyone can help me with that?
Because of CSS precedence.
Change your selector to:
See Working Demo