|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
macrumors 6502a
Join Date: Apr 2007
Location: Reston, VA
|
Odd CSS problem
Hi all, first post in this subforum.
I am trying to get back into PHP/CSS/etc, and having a little problem with something - on my web hosting, my CSS is not working at all, however when I access my site locally through Xampp, it shows up fine. Any ideas what could cause this? Here's the code: header.php HTML Code:
<html> <head> <title>Sound Void</title> <link rel="stylesheet" type="text/css" href="css/formatting.css" /> </head> <body> <div id="header"><?php include("title.html"); ?></div> <div id="divider"><?php include("topnav.html"); ?></div> <div id="content"> PHP Code:
Also, while I'm here, what does everyone here use for editing PHP/html on a mac? I was working with Vim last night but it doesn't seem to have color coding, which I prefer for writing code. Suggestions?
__________________
"It is just that heavy metal musicians write in minor keys, and when you do that, you frighten people." - Ronnie James Dio Flickr |
|
|
|
|
|
#2 |
|
macrumors 68040
Join Date: Apr 2004
|
If it works locally but on when hosted, it's likely an issue with the path to the css file. The request for the css ("css/formatting.css") is probably not being resolved to the location you expect. Try using a path relative to your header.php.
I get syntax color with vim and gvim, but then I've been using the same .gvimrc and .vimrc files for years, copying from machine to machine, and I don't really know what's different between my rc files and the defaults. Actually, I just remembered. Try typing ":syntax on" when you're editing. You can add that to .vimrc and .gvimrc. I prefer gvim, by the way. Edit: I've uploaded my .gvimrc and .vimrc if you want to take a look. Copy gvimrc.txt to your home directory as .gvimrc and vimrc.txt as .vimrc (backup your own copies first, if you have them) I've also used TextWrangler, which has syntax highlighting. It works well, but my fingers still keep trying to do the vi commands. Last edited by plinden : Jun 1, 2007 at 11:28 AM. |
|
|
|
|
|
#3 | |
|
Thread Starter
macrumors 6502a
Join Date: Apr 2007
Location: Reston, VA
|
Quote:
As for the relative path, that path is correct. header.php resides in the same directory that also contains the css folder. I kept the directory structure in tact when uploading to my server. I don't see why this isn't working unless it could be a permissions issue. Is this likely?
__________________
"It is just that heavy metal musicians write in minor keys, and when you do that, you frighten people." - Ronnie James Dio Flickr |
|
|
|
|
|
|
#4 |
|
macrumors 68040
Join Date: Apr 2004
|
What do you get when you type http://host/path/css/formatting.css ... where host is your hosted server, and path is the the path to your header.php (which may be empty)?
If your page isn't loading the css file, the path to it likely to be wrong, no matter what you think is right. I've had this issue myself, and modifying the path usually fixes it. This is especially an issue where you're including a file containing the link to a css or image. If your directory structure is like: Code:
|- header.php
|- css
|- formatting.css
|
|
|
|
|
|
#5 | ||
|
Thread Starter
macrumors 6502a
Join Date: Apr 2007
Location: Reston, VA
|
Quote:
I get this message trying to go to the css file directly: Quote:
Also, I've tried the ./css/formatting.css as well with the same results.
__________________
"It is just that heavy metal musicians write in minor keys, and when you do that, you frighten people." - Ronnie James Dio Flickr |
||
|
|
|
|
|
#6 |
|
Thread Starter
macrumors 6502a
Join Date: Apr 2007
Location: Reston, VA
|
Wow, I just fixed the problem by giving the folder chmod 755...I wonder why it didn't have these permissions by default.
__________________
"It is just that heavy metal musicians write in minor keys, and when you do that, you frighten people." - Ronnie James Dio Flickr |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|