Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Gooden

macrumors member
Original poster
Jun 7, 2009
45
0
Hello,

I am very new to macs and need some help with viewing my websites that I have designed and coded locally. For instance on a PC you could just make a file called whatever then inside have your index.html / style.css etc and be able to view them straight up, but I can't seem to do that on the mac. I'm sure you must be able to or is there a different way of doing so on a mac?

All help is appreciated

Thanks
Steve
 

i.shaun

macrumors 6502a
May 1, 2008
784
0
Canada
I'm not quite sure what you're referring to. . Is the HTML file not opening in Safari (or whatever browser you're using)?



edit: Placing an HTML file and related images/resources in the same directory should work the same as in Windows
 

Gooden

macrumors member
Original poster
Jun 7, 2009
45
0
Hello,

It doesn't seem to work for me. I have say a folder in documents called Website then all my resources in there, go to open the index.html and nothing loads! Unlike in windows it would.

Does that help :p

Thanks
Steve
 

redwarrior

macrumors 603
Apr 7, 2008
5,573
4
in the Dawg house
You probably need to right click and tell it what to open with. There may be several choices, but I don't know why it's not defaulting to something.:confused:
 

i.shaun

macrumors 6502a
May 1, 2008
784
0
Canada
Hmm, how are you linking to pictures and stuff in the index HTML file? I thought it was the same across platforms.


What I do is have the Index file in a folder, say:

Websites/

In the HTML, any link to an image in that same directory is simply "image.jpg" If my image or other resource is in a sub folder:

Websites/Images

I will Link accordingly "Images/image.jpg"


Does that help?
 

miles01110

macrumors Core
Jul 24, 2006
19,260
36
The Ivory Tower (I'm not coming down)
It doesn't seem to work for me. I have say a folder in documents called Website then all my resources in there, go to open the index.html and nothing loads! Unlike in windows it would.

You need to specify the full path to your images and CSS template. If your stuff is in Documents/Website/ you would use

Code:
<img src="/Documents/Website/image.jpg" alt="My image" />

Also, this should probably be moved to the Web Dev forum.
 

michael.lauden

macrumors 68020
Dec 25, 2008
2,326
1
sounds like you need to invest in an Intro to HTML book, O'Reilly makes a great one that includes CSS and XHTML that i am currently going through!
 

Coomkeen

macrumors newbie
Apr 21, 2008
18
0
sounds like you need to invest in an Intro to HTML book, O'Reilly makes a great one that includes CSS and XHTML that i am currently going through!

Surely, regardless of whether it's valid HTML or not, if it's got the .html file ending it should open Safari or Firefox or whatever, even if it gets an error message.

Try saving any old rubbish as an rtf file from TextEdit, then changing the ending to html, and double-clicking it.
It should open in the default browser and show whatever junk you put in the file.
 

Yvan256

macrumors 603
Jul 5, 2004
5,081
998
Canada
You need to specify the full path to your images and CSS template. If your stuff is in Documents/Website/ you would use

Code:
<img src="/Documents/Website/image.jpg" alt="My image" />

Also, this should probably be moved to the Web Dev forum.

I'm sorry but doing a full path on the ressources is not the way to go. If he then uploads to a web server he'll have to edit all those paths to be either relative or absolute.

I'd suggest using relative paths, that way it will work both locally and once uploaded to a web server.

Anyway, he should be using Mac OS X's built-in "Personal Web Sharing", which is Apache already installed on your computer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.