Mysmasken Posted March 17, 2007 Share Posted March 17, 2007 Hi guys. I'm kinda to PHP and wanted to make my site with PHP. I made a guestbook and I'm trying to display the posts in it. Simple enough. Here's the problem. I added in my CSS-file that I want links to be green and to underline on hover. I use IE6 and it won't work, I have not tried IE7 cause I don't have it. I tried back and forth, all kind of ways, and I think I know what happens. As long as I link the link with "http://" in the beginning it won't work. If I remove that, it will show my CSS. Why is this? It seems to be IE bug, cause they will all show in green in Firefox (however the underline wont show, I dunno why either lol). Oh, here is my guestbook (still in the works): http://www . mysmasken . se/guestbook.php Quote Link to comment Share on other sites More sharing options...
Mysmasken Posted March 18, 2007 Author Share Posted March 18, 2007 Nevermind, I kinda found a solution. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 18, 2007 Share Posted March 18, 2007 Your html is not valid. So how can you expect the browser to comply with what you want your page to look like. Any HTML document should at least have the basic set of tags which is this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Your site/page title</title> <!-- link any external pages here, eg stylesheets or javascript files. --> </head> <body> <!-- all html code for the page here --> </body> </html> Yours only has the first two lines! Also you close your tags in the incorrect order which will make your code invalid. This: <div class="gbname"><a href="http://www.scrappa.com" target="_blank">Scrappa.com</div></a> is supposed to be this: <div class="gbname"><a href="http://www.scrappa.com" target="_blank">Scrappa.com</a></div> If you make your code valid then the browser will abide by what you tell it. Otherwise it will go into quirks mode. Another thing is try to format your html code too. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted March 18, 2007 Share Posted March 18, 2007 And, in order for your css to be used you have to specify it in the HEAD section like this: <link rel="stylesheet" href="styles.css" type="text/css"> or you can define inline css styles in the HEAD section like this: <head> <title>bla</title> <style type="text/javascript"> .someclass { color:red; font-size:120%; } ...repeat above </style> </head> --that ain't no ie bug, you can't blame that one on ie. It probably displayed green in ff because that is your default settings for that browser. ff shouldn't be rendering your css either because you never linked to your css or included it inline. Quote Link to comment 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.