I'm trying to adjust the width of my IFrame based on the size of the browser window. However, my current code is not producing the desired outcome even after refreshing the page. Can anyone pinpoint where I am going wrong?
Here is the HTML snippet:
<p>A simple frame example:<br>
<iframe src="www.google.com">
</iframe>
</p>
Initially, I include a stylesheet that functions correctly except for this particular aspect:
iframe
{
<script>
if (window.innerWidth<800px)
{
width="200";
}
else
{
width="400";
}
</script>
height="400";
}
Any suggestions on how I can enhance this setup?