My code is like this.
some text here
CSS:
You could use a container div:
some text here
Then use that to handle the float
, and make its child position: fixed
.outer {
width:50%;
height:600px;
background-color:red;
margin:0 auto;
position: relative;
}
.floatcontainer {
float: right;
}
.inner {
border:1px solid white;
position:fixed;
}
.floatcontainer, .inner{
width: 50px;
}