In a CSS fluid layout all divs use percentages. However, I need my sidebar to have a fixed position.
Example:
<aside style="width:25%; float:left; position:fixed;">
aside content
</aside>
<div style="width:75%; float:left;">
main content
</div>
What I'm really trying to do is to make the sidebar keep a specific width according to the viewport. For example I need it to be 300px wide if the viewport is between 1000 and 1200 px wide.
An alternative: I also want it to be 300px wide when its parent div (I know I din't mention a parent div in the example above) is larger than say 1000px.
I guess it takes some JS to do it but I'm a complete idiot when it comes to JS so your help would be much appreciated. Thank you.