peter11 Posted June 4, 2010 Share Posted June 4, 2010 Why does this not work? echo '<head>'; echo ' <link rel="stylesheet" href="css.css" type="text/css">'; echo '</head>'; Further down i have: echo "<div class='1'>ENTER SOMETHING !!</div>"; in the CSS i have: .1{ font-size:24px; } Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/ Share on other sites More sharing options...
.Stealth Posted June 4, 2010 Share Posted June 4, 2010 What doesn't work? It doesn't echo or the CSS doesn't apply to "1"? Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067851 Share on other sites More sharing options...
TheBG Posted June 4, 2010 Share Posted June 4, 2010 Have cleared the cache? Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067852 Share on other sites More sharing options...
peter11 Posted June 4, 2010 Author Share Posted June 4, 2010 It doesn't apply the style to the text "ENTER SOMETHING !!" It just appears as normal im doing CTRL+R so any changes it should show. Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067853 Share on other sites More sharing options...
peter11 Posted June 4, 2010 Author Share Posted June 4, 2010 Anyone know why this is not working? :S Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067896 Share on other sites More sharing options...
Zagga Posted June 4, 2010 Share Posted June 4, 2010 Are you sure the .css file is in the same directory as the page you are testing? Are you echoing <html> and <body> correctly as well? Zagga Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067907 Share on other sites More sharing options...
peter11 Posted June 4, 2010 Author Share Posted June 4, 2010 Yes its in the same directory. My application is being built into facebook so if i include the body tags it gives errors and i have tried wrapping in <html> Do you think the problem is its not in the <body> tags? I dont think facebook allows this. Any way around that you can think of? Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067915 Share on other sites More sharing options...
kenrbnsn Posted June 4, 2010 Share Posted June 4, 2010 I believe you can not have a class name that starts with a number. Try using one that starts with a letter. Ken Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067932 Share on other sites More sharing options...
peter11 Posted June 4, 2010 Author Share Posted June 4, 2010 I tried calling it "test" on the CSS and PHP still no luck Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067941 Share on other sites More sharing options...
Zagga Posted June 4, 2010 Share Posted June 4, 2010 If FaceSpace doesn't allow you to use the <body> tag, it probable means the <body> tag has already been opened before your code is added, and then closed after your code. If this is the case, you won't be able to edit the <head> tag either (as this comes before the body tag). Zagga Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067952 Share on other sites More sharing options...
peter11 Posted June 4, 2010 Author Share Posted June 4, 2010 Fixed. It needed the whole link to the file not just /css.css Im still not too sure why but its fixed it thanks all for the help. Link to comment https://forums.phpfreaks.com/topic/203885-include-css-file-help/#findComment-1067954 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.