2

Can anyone tell me why css stylings are not working on the iframe. I tried using both inline as well as external css

    iframe{
       height: 100%; border:2px solid black; 
    } 
    <link rel="stylesheet" href="new.css">
   <iframe class="fr" id="contentt" name="contentt"></iframe>
   
  
    <li><a href="t.php" target="content">Career Profiling Test</a></li>
    <li><a href="app.php" target="content">Schedule Appointment</a></li>
    <li><a href="out.php" target="content">Sign Out</a></li>
    </ul>
   

My Php Looks Like

session_start();
if(isset($_SESSION['signed_in']) && $_SESSION['signed_in'] == true)
{
  echo'<h3 style="color:green; text-align:right;">WELCOME 
 '.$_SESSION['first_name'].'</h3>';
}
echo '<ul class="ver">';
Ram Chandra Neupane
  • 1,826
  • 3
  • 19
  • 36
Gargi
  • 41
  • 1
  • 8
  • 1
    Refer : https://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe – Abhishek Kumar Jul 24 '18 at 10:08
  • 1
    Possible duplicate of [How to apply CSS to iframe?](https://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe) – Sreekumar P Jul 24 '18 at 10:44
  • @SreekumarP...not a duplicate.. I am asking u guys what is wrong in my code.. – Gargi Jul 24 '18 at 10:52
  • @Gargi What specifically is not working? Does the iframe not have 100% height, not have the border, or both? If you right click on the iframe and choose "Inspect", does the browser show those styles at all? As it stands, I'm not sure anyone can help you as it's unclear specifically what the problem is. – thunderblaster Jul 24 '18 at 13:06
  • Your code has 100% height for the frame, but it doesn't specify 100% of what. None of its ancestors have heights defined. So the 100% is ignored. – Mr Lister Jul 24 '18 at 13:12
  • @thunderblaster both are not being shown – Gargi Jul 27 '18 at 06:14
  • Did you look into Mr Lister's advice? Try setting the `height` to `100vh` instead of `100%` (or any non-percentage value). – thunderblaster Jul 27 '18 at 11:31
  • @thunderblaster..worked!..tysm – Gargi Aug 02 '18 at 07:05

0 Answers0