So, I have an application with global navigation, which is on the left side of the page. Tapping this navigation updates <iframe>which fills the rest of the page.
I managed to get <iframe>to fill the page, but adding this field to 160 pixels to the left is difficult. I tried to install left:160px, margin-left:160px, padding-left:160pxall to no avail.
Any ideas on how I can do this? Code and script below:
<nav>
<ul>
<li>Item1</li>
<li>Item2</li>
</ul>
</nav>
<iframe src="http://cnn.com" frameborder="0" name="product_iframe" id="main_iframe" height="100%" width="100%"></iframe>
<style type="text/css">
#main_iframe {position:fixed;height:100%;width:100%;top:0px;left:0px;right:0px;bottom:0px; z-index:1}
nav {position:fixed; left:0px; top:0px; bottom:0px; width:160px; background:#333; color:#fff; z-index:2}
</style>
Here is the fiddle
source
share