Can someone please explain why my articles div appears below my sidebar div?
http://www.api.jonathanlyon.com/getpocket/view.html
You will need to select an item in the dropdown first
Thanks
Jonathan
Can someone please explain why my articles div appears below my sidebar div?
http://www.api.jonathanlyon.com/getpocket/view.html
You will need to select an item in the dropdown first
Thanks
Jonathan
get rid of the float:left
on your container
and articles
divs
Remove the float attribute on the 'container' div and it will work correctly.
[edit] The float attribute on 'bigcontainer' is also unnecessary.
The cause of this issue is probably as follows: floated elements are ignored when computing the dimensions of the enclosing element. You have floated both 'lsidebar' and 'container', so there is nothing left in 'bigcontainer' and its computed width is zero. As a result, when the 'container' element is placed, there is no horizontal space left in the enclosing 'bigcontainer' element, so it is placed below the 'lsidebar' element.
As per my concern the markup should be somthing like this:
<div id="mainWrap">
<div id="sidebar">
</div>
<div id="article">
</div>
</div>
and its styling should be like this
#mainWrap{
#some basic styling like width
}
#sidebar{
#some basic styling like width and float:left
}
#article{
#some basic styling like width and float:right
}
Its as per standard markup and css standard.
In your case container is having float:left and which is too large thats why its going down. Remove float:left and it will be fine.
Thank you!
This is because of the <div id="container">
width which is too large. Reduce the width and it will appear just next to your sidebar.