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'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
 
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
 
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:
 
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?
 
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.
 
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!
 
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.
 
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.