witchy478 Posted June 22, 2012 Share Posted June 22, 2012 Hi I'm trying to link my css with my webpage but for some reason it's not working and I don't understand why because everything is right. this is the link <link rel="stylesheet" type="text/css" href="stylesheet.css" /> Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/ Share on other sites More sharing options...
Mahngiel Posted June 22, 2012 Share Posted June 22, 2012 There are a dozen scenarios I could think of, so you'll need to be a bit more expressive than "it doesn't work". Try Ctrl+F5 to dump cache and reload Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1356121 Share on other sites More sharing options...
Pikachu2000 Posted June 22, 2012 Share Posted June 22, 2012 Use the full URL to the stylesheet.css file. href="http://www.my_server/path-to-file/stylesheet.css" Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1356125 Share on other sites More sharing options...
witchy478 Posted June 26, 2012 Author Share Posted June 26, 2012 Nothing happens, I don't even get any errors. Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1357270 Share on other sites More sharing options...
witchy478 Posted June 27, 2012 Author Share Posted June 27, 2012 Maybe this will help I'm using zend framework Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1357450 Share on other sites More sharing options...
Pikachu2000 Posted June 27, 2012 Share Posted June 27, 2012 What does "nothing happens" mean? Blank screen? Markup renders, but without styling? Something else? Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1357451 Share on other sites More sharing options...
witchy478 Posted June 27, 2012 Author Share Posted June 27, 2012 Originally my page has a white background and the heading is black. So I wanted the background to be Blue and the heading to be red. But I don't get the colors that I want, it stays the same. Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1357453 Share on other sites More sharing options...
Pikachu2000 Posted June 27, 2012 Share Posted June 27, 2012 You should start by viewing the page source to see if there are any obvious problems like conflicting <link tags, misspellings etc. Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1357458 Share on other sites More sharing options...
witchy478 Posted June 27, 2012 Author Share Posted June 27, 2012 It looks fine to me. This is what's on the page source <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Voluptous Decedants</title> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> </head> <body> <h1>home</h1> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1357460 Share on other sites More sharing options...
Jessica Posted June 27, 2012 Share Posted June 27, 2012 Use the full URL to the stylesheet.css file. href="http://www.my_server/path-to-file/stylesheet.css" Do that, and if it doesn't work show us the contents of your css file Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1357556 Share on other sites More sharing options...
witchy478 Posted July 2, 2012 Author Share Posted July 2, 2012 No it doesn't but here is my stylesheet.css body{ background-color:#0000CD; } h1{ color: #FF0000; } Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1358532 Share on other sites More sharing options...
Mahngiel Posted July 2, 2012 Share Posted July 2, 2012 No it doesn't but here is my stylesheet.css Then you're not linking to your stylesheet, which is the core of the problem you're facing here. At the most basic level, you must define the path to your stylesheet relatively from the page loading it. If your web page is in folder /public_html/awesome_app/ where your web assets are in folder public_html/awesome_app/assets, index.php calling the stylesheet would need to link to it appropriately with <link rel="stylesheet" type="text/css" href="./assets/stylesheet.css" /> Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1358533 Share on other sites More sharing options...
witchy478 Posted July 2, 2012 Author Share Posted July 2, 2012 I think that this might be a zend framework problem, because I made a new webpage with a stylesheet and it works. Quote Link to comment https://forums.phpfreaks.com/topic/264610-css-linking-problem/#findComment-1358536 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.