I have two containers.
When the screen is 500px or less these containers need to sit on top of each other, and both take up 100% of the screen.
When the screen is more than 500px they need to be side by side both taking up equal width of the screen horizontal space.
This needs to work in ie8. I can’t use media queries.
Is this possible just using CSS? (no JavaScript)
This is only possible in browsers that support Media Queries, but sadly IE8 does not, though you can get a JS plugin (Respond.js or similar) that will make them work on IE8.
This is a working version in browsers that support media queries
The key piece of code is
Support for Media Queries can be seen here