natturefrk Posted October 3, 2017 Share Posted October 3, 2017 (edited) Okay I have been at this for two days now trying to figure out the source of the problem. When I use firebug to inspect the elements there is no css being applied, even though the link to external stylesheet is correct. When I use chrome developer to inspect the elements it seems default styles are being applied but not the styles I set. I checked the network portion of firebug and chrome developer and the css file in question is no where to be found. So this leads me to believe that the css file is not being loaded. I don't know if this matters but the table info on this page is being dynamically generated by php. The only way that I can get the styles to apply is if I put all the css in external stylesheet internally into stats.php. Another thing I have noticed is that I cannot use classes on any of the dynamically created content and I had to use a mix between tag selectors and inline styling. The page in question is: http://www.skillersrealm.com/includes/scripts/stats.php?rsn=CrypticKaxarThis is what the page is suppose to look like:https://imgur.com/a/kexYV css file:http://skillersrealm.com/includes/css/stat.css <?php $dir_sep = DIRECTORY_SEPARATOR; $back_one = '..' . $dir_sep; $back_two = '..' . $dir_sep . '..' . $dir_sep; require_once __DIR__ . $dir_sep . $back_one . 'init.php'; if(isset($_GET['rsn']) === TRUE){ $rsn = $_GET['rsn']; $query = $conn->prepare("SELECT points, xp, part_total, conduct_total, conduct_pts, help_pts, cit_pts, event_pts, talk_pts FROM users WHERE rsn = :rsn"); $query->execute(array(":rsn" => $rsn)); ?> <!-- END PHP --> <style type="text/css" media="screen"> </style> <!DOCTYPE html> <html> <head> <!-- INCLUDE GOOGLE FONT --> <link href="https://fonts.googleapis.com/css?family=Handlee" rel="stylesheet"> <link rel="stylesheet" src="../css/stat.css" type="text/css" media="screen" /> </head> <body> <div class="mask"> <div class="content"> <div class="stats_container"> <div style="float: left; padding-left: 1%;"><img src="../images/staff.png" alt="" height="750" width="200" style="float: left;" /></div> <div style="float: right; padding-right: 1%;"><img src="../images/staff2.png" alt="" height="750" width="200" /></div> <h3 style="color: rgba(50, 205, 50, 1.0);"><?php echo $rsn; ?>'s Stat Page</h3> <table class="stats" border="1"> <!-- START PHP --> <?php while($row = $query->fetch(PDO::FETCH_ASSOC)){ $grand_total = $row['points']; $xp = $row['xp']; $cit_pts = $row['cit_pts']; $event_pts = $row['event_pts']; $talk_pts = $row['talk_pts']; $conduct_pts = $row['conduct_pts']; $help_pts = $row['help_pts']; $conduct_total = $row['conduct_total']; $part_total = $row['part_total']; } //BRINGS IN THE POINTS TABLES require_once __DIR__ . $dir_sep .$back_two . 'templates' . $dir_sep . "stats_tables.php"; } ?> <!-- END PHP --> </table><br /><br /> <?php //if(logged_in() === TRUE && $admin_id ="1" || $admin_id = "2"){ //BRINGS IN THE POINT BUTTONS require_once __DIR__ . $dir_sep .$back_two . 'templates' . $dir_sep . "pts_btns.php"; //} ?> </div><!-- END OF .STATS_CONTAINER DIV --> </div><!-- END OF .CONTENT DIV --> </div><!-- END OF .MASK DIV--> </body> </html> Edited October 3, 2017 by natturefrk Quote Link to comment https://forums.phpfreaks.com/topic/305187-css-not-loading-despite-linking-to-it-correctly/ Share on other sites More sharing options...
Solution requinix Posted October 3, 2017 Solution Share Posted October 3, 2017 Take a look at these two lines: <link href="https://fonts.googleapis.com/css?family=Handlee" rel="stylesheet"> <link rel="stylesheet" src="../css/stat.css" type="text/css" media="screen" />The first one works and the second one doesn't. There are three differences between them and one of them is the source of the problem. Can you find it? 2 Quote Link to comment https://forums.phpfreaks.com/topic/305187-css-not-loading-despite-linking-to-it-correctly/#findComment-1552272 Share on other sites More sharing options...
natturefrk Posted October 4, 2017 Author Share Posted October 4, 2017 Wow I just feel stupid. I have been dealing with these problems with my css acting weirdly that I didn't even notice that I made that mistake. Here is the weirder part is that before internally I couldn't assign classes to the dynamic content now it is letting me do it Quote Link to comment https://forums.phpfreaks.com/topic/305187-css-not-loading-despite-linking-to-it-correctly/#findComment-1552311 Share on other sites More sharing options...
natturefrk Posted October 4, 2017 Author Share Posted October 4, 2017 (edited) I am thinking it was the hack I was using to stop caching, because originally I was having issues with caching and css not updating. I am not having the issues, fingers crossed, now Edited October 4, 2017 by natturefrk Quote Link to comment https://forums.phpfreaks.com/topic/305187-css-not-loading-despite-linking-to-it-correctly/#findComment-1552312 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.