Okay so I would like this iframe to fill 100% of it's parent div which is wrapper with width 900 px and for some reason I'm unable to get this done
HTML
<fieldset>
<legend>Random Patch:</legend>
<iframe src="../../index.php?Patch_No='.$patches[$patch].'" frameborder="0" ></iframe>
</fieldset>';
CSS update the syntax is like that in code but still doesn't work I got confused with html for a second here is how it looks: http://i.imgur.com/9Jv5sFz.png
iframe {
width: 100%;
height: 500px;
}
UPdate 2 whole html
<body>
<div id="wrapper">
<header>
<div id="menu"> <a href="new_patch/new_champions.php" id="new">NEW</a>
<!-- Editing patches still in works href="edit_patch.php" -->
<a id="edit" style="color: grey;" alt="Edit" title="Disabled still in works.">EDIT</a>
<a href="delete_patch.php" id="delete">DELETE</a>
<a href="logout.php" id="logout">LOGOUT</a>
</div>
</header>
<div id="sitelive">
<?php
//Generating random patch from DB
$sql="SELECT Patch_No FROM info";
$result=$ conn->query($sql);
$patches=$result->num_rows;
if($patches!=0) {
$patch = rand(1, $patches);
$i = 1;
$patches = array();
while($data=$result->fetch_assoc()){
$patches[$i] = $data['Patch_No'];
$i+=1;
}
echo '
<fieldset>
<legend>Random Patch:</legend>
<iframe src="../../index.php?Patch_No='.$patches[$patch].'" frameborder="0" height="500" width="100%" scrolling="no"></iframe>
</fieldset>';
} ?>
</div>
</div>
</body>
Change your CSS like this: Updated Demo
iframe {
width:100%;
height:500px;
}
fieldset, legend {
margin:0;
padding:0;
width:100%;
height:100%;
}
HTML:
<fieldset>
<legend>Random Patch:</legend>
<iframe src="../../index.php?Patch_No='.$patches[$patch].'" frameborder="0"></iframe>
</fieldset>
Hope this is what you want..
Your CSS syntax seems to be faulty
I think this will solve it:
iframe {
width:100%;
height:500px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With