I made some websites. I don’t remember what editor I used. Even if I did, I no longer use a PC. I think it’s time to make some changes. I copied the source code into a word document and saved it as a .htm file. I thought I could just open the file with a browser, and there would be the page. Nope. I got the source code. How do I open my .htm file as a webpage instead of a bunch of HTML?
I tried downloading Komodo Edit, but when I view the file there I still only get the HTML. It’s been over a decade since I’ve done any work on a webpage… since I switched from PC to Mac.
Don’t use Word. Use a text editor. A plain text editor.
Can you get Notepad++ for Mac? That’s my favorite editor right now. It has a “run” menu and you can choose “Run in Firefox” (or any browser) to run your HTML in the browser.
When you say “saved it as a .htm file” did you just save it as a Word file with a .htm extension? Because that won’t work. It needs to be a plain text file.
Despite it’s name, I don’t think TextEdit’s default behavior is to open a file as plain text. Try to reopen the file in TextEdit, choose Format > Make Plain Text from the menu, and save it again as a .htm file. Then open that .htm file in Safari.
No option to save as .html, but I renamed to .html and I kind of got a page. There are  characters that I don’t know what they are, and the images didn’t show up (because they’re just the file names instead of the address).
To make a web page from scratch using a text editor you need to understand at least a little bit of HTML. Images, links, etc. need to be specified by tags that tell the browser what they are.
Try pasting this into an empty text document and saving it as mypage.html
<html>
<body>
Hello World
<img src="http://pixelduke.files.wordpress.com/2010/01/jnbdec2008-hello-world-example2.png">
</body>
</html>
If you open that file in Safari and see the text “hello world” and a picture that says “hello world” all is well, and the other problems you’re seeing are errors in your HTML code.
Some operating systems (Windows in particular; I don’t know about any Apple systems)
go to heroic lengths to hide the file name extensions from the user.
When you open a file like whatever.htm and then try to save it as a .txt file, it
just might end up being whatever.htm.txt but you don’t see the .txt part.
Or, depending on the contortions you tried, maybe you now have whatever.txt.htm
which appears as whatever.txt while hiding the .htm – it all depends on how “helpful” :smack:
your chosen text editor tries to be.
You definitely need to make sure your .htm (or .html) file is a PLAIN TEXT
file, BUT it’s name should end with .htm or .html, not .txt or anything else.
Editors that produce formatted documents like Microsoft Word are NOT what you want,
unless you are using a WYSIWYG editor that specifically will create HTML documents
for you (which, by the way, MS Word is able to do).
Here, by the way, is my HTML stub starter-page template:
<!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">
<!-- The head section: -->
<head>
<title>xxxxx</title>
</head>
<!-- The body section: -->
<body>
<noscript>
<h2><font color="red">You probably ought to enable JavaScript!</font></h2>
</noscript>
Body text here
</body>
</html>
I used to know HTML, but I’ve forgotten it through disuse. I tried your code and it worked. I hypothesised that the weird characters were an artifact from the initial attempt to create the file in Word. I recopied the source code from the existing page into TextEdit, edited it, and renamed to .html. That did the trick. Now I just need to find my FTP application…
I copied the source code into a word document and saved it as a .htm file.
This is a mistake and that file is permanently garbage.
Start over and copy the source code into a text editor, NOT a word processor. When you want to see the code, keep it as a .txt file. When you want to see the “web page” rename the file to a .htm or .html extension and open it in a browser.
HTML is plain text.
the images didn’t show up (because they’re just the file names instead of the address)
If the image files are stored in the same directory/folder as the page calling them, they don’t need a pathway (address). If they aren’t, they do.
OK, that brings me to my original quest: To find a program I can make webpages with. Word does it? WYSIWYG is nice. ISTR my old editor from the '90s did that. Once I had the rough page, I’d go into the HTML and edit it to get what I wanted.
I presume Word has a ‘Save as HTML’ option? I haven’t looked. Or, what’s a good program for making webpages?
If you do that, it becomes a problem if you want to move the entire web site, with all its files, en masse to some other hosting site. You would have to search through all your pages and find every such URL and change them.
If you just use relative file names, you wouldn’t have to do that.
ETA: Creating a web page with MS Word: It’s been a few years (I learned this in a class several years before “the ribbon”): IIRC, you have to poke around the menus; I think you’re looking for something that says “Publish . . .” or “Publish to web . . .” or something like that.
I think all of us that know how to do it are going to shy away from hand-holding JLA through this. I mean, yes it’s easy but I’m guessing most of us couldn’t stand up and teach a class on it.
It’d be like someone asking here how to re-wire a lamp, and they can’t even figure out how to unscrew the lightbulb. From step one it’s just going to be a lot more work from the explain-er than they really want to take on via the Internet.
And I mean no disrespect to** JLA**. He knows I know he’s not an idiot. He just…doesn’t know this thing. I’m hoping he doesn’t think I’m an idiot because I can’t fly a plane!
Anyway,** Johnny**, I suggest you poke around on the Internet and read some tutorials on how to do HTML from scratch. Or even go check out a “Web pages for dummies” book if you’re that kind of learner. W3Schools is a site I often come back to, even after 15+ years in the business. Here’s their HTML Guide.
As for editors…WYSIWYG editors are all kind of shit. It’s just plain hard to make a program make good HTML from a graphical interface. It’s like trying to get Disney animation from Lego. Square peg in a round hole. You’re going to end up with shit HTML and then trying to fix one little thing that you just can’t get to work right which will take a ton of time to fix but wouldn’t have happened in the first place if the editor didn’t mess it up.
So it’s hard for someone who knows actual HTML to suggest a WYSIWYG editor. And I don’t see people that don’t know HTML busting out to suggest one either.
Really, any one you get will be adequate.
FWIW, there are plenty of good-enough sites that use interfaces like Weebly (which is good for product/service sites), WordPress hosted (good for informational sites) and the like. They may look a little cookie-cutter but they also take a lot of the work out of your hands and give you some cool features in return.
Dreamweaver is the standard but it’s very expensive, though you can also subscribe to it on a monthly basis. Here are a bunch of alternatives:
I’d suggest doing what ZipperJJ said, going with somebody like Weebly or (my suggestion) Squarespace or Wordpress. They host it, take care of all the coding, you just drag and drop things and write your content.
There’s no reason to roll your own HTML if you don’t know what you’re doing.
As for:
Wanna trade web lessons for flying lessons? We could start a mile-high coding club.
We also suggest you link to other pages of your site using absolute, rather than relative, links with the version of the domain you want to be indexed under. For instance, from your home page, rather than link to products.html, link to http://www.example.com/products.html . And whenever possible, make sure that other sites are linking to you using the version of the domain name that you prefer.
Fun times, but it’s not really helpful for a guy who’s planning to develop a static HTML site on his computer.
If shit’s not relative, every time he clicks a link on his site, locally, it’ll take him to the Web version. And that will get old quick.
Don’t try to confuse a newbie with “rank me one thousandth of a percent higher!” coding “must-dos” decided on by SEO managers.
A good suggestion would be “use relative links, keep your directories organized, and keep your code organized so that you don’t mess up relative links.” Or don’t use directories because…why do you need directories?
Then once you’re in the big time and using dynamic code and you’ve done all you possibly can to make the code good AND spider-able, then you go ahead and make all your links absolute.
Since it’s going to be published and hosted, one may as well do it right in the first place.
And once it’s FTPed up there asap there will be no reason to work on a local version.
I despise SEO as well as the next man, but whatever Google’s faults I doubt they are describing best practice so as to game their own system.
Directories are good. They enable separation of types of resources instead of throwing everything up in one big scatterbox. To some extent they enable domain-sharding, which is not ideal ( although better than the ghastly CDN craze of pulling elements from all over the web ), but if an element goes bad, and I’ve had that with audio/video etc., it’s easier to replace if there’s a place where it must be.
WordPress is fine ( or was, like everything else due to fashion it’s simultaneously getting too complicated and too minimalistic ) but adding an image with their upload system has many problems, whereas oldschool adding an absolute path to an image in a directories still works absolutely. Plus centering just works.
I agree with everyone not to use Word, but it does have a save as html option. In fact several. You can save it as a single page, or as a page and a subdirectory with stuff like graphics files. In fact the best way to extract an image from a word file is to save it as html,. and then find the image in a subdirectory Word creates.