Can I apply both position: relative
and float: left
on one element? Like this:
div {
float: left;
position: relative;
top: 0px;
I want to provide a different answer in case it may help someone. I had two side by side div's that I wanted them to take up space:
stuff
other stuff
I used to do this by applying after all my floating ones. This used to work because
.clear { clear: both; }
would solve the problem. This no longer works for me. Instead, I followed these instructions and added this class to my container:
.noFloat {
width: 100%;
overflow: auto; //If you get a scroll bar, try overflow: hidden;
float: none;
}
so I ended up with:
...
Here is a link to a bootply.com example: http://www.bootply.com/EupCHRhV4s