steamtronic Posted February 29, 2012 Report Share Posted February 29, 2012 Please be gentle. Please be gentle. Please be gentle. <deep breath> Ok, I'm brand new to web design. Ive been through the w3schools site and am pouring over my "Building Websites for Dummies" Books (both the Sahlin/Snell all-in-one second edition AND the Crowther versions) but cannot seem to find an answer to this most basic of problems: When coding HTML, what program do I write it in, and what file format (ie extention) do I save it in? Ive written some very basic intro stuff in MSWord and Wordpad (Windows VISTA 32) , then saved in .HTM, .HTML, .RTF, and .TXT formats - yet I get the same problem - when I open them in any browser (IE9, Chrome 17, Firefox 3 or Opera 11) the document appears exactly as written - HTML tags & all. When I view the source there appears to be a huge amount of extra HTML code automatically added. What am I doing wrong? What should I be doing? Please help! Quote Link to comment Share on other sites More sharing options...
Wickham Posted February 29, 2012 Report Share Posted February 29, 2012 (edited) First and very importantly, DON'T save from a Word file as Word carries over unwanted formatting to some characters like " and ' . Use Notepad for writing code or Notepad++ or special text editing program or save from Word into Notepad first which should destroy the unwanted hidden formatting. Wordpad is another alternative, but I use Notepad and that's OK. Save your files with .html or .htm extension (.html is more common than .htm) or save with .php extension if you have PHP code on the page that will need server processing (unlikely if you are a beginner). Make sure when you save your files that you Save As: Type: All Files (*.*), not Text Documents (*.txt), and also use Encoding ANSI. Then check in your file list eg Windows Explorer that the file has been saved as myfile.html and not myfile.html.txt as sometimes the .txt gets added automatically and you don't want that. Use index.html for your home page as when a user just types in www.your-domain-name.com the server will automatically look for a file called index.html (or index.htm or index.php). When you want to look at a file called index.html or myfile.html on your browser, just double click the filename in the list and it should open up in the browser after processing the html code. If you want to edit the file in Notepad, use right click Open with Notepad. If you have progressed to stylesheets, these files should be written in Notepad (or another special text editor) and saved with .css extension (like my-style.css) and a link given in the head section of every html page like:- <link rel="stylesheet" href="my-style.css" media="all" type="text/css"> Edited February 29, 2012 by Wickham Quote Link to comment Share on other sites More sharing options...
steamtronic Posted February 29, 2012 Author Report Share Posted February 29, 2012 Thanks! Using Notepad rather than Word did the trick. It still wont open in Opera, but Ill worry about that later once I'm a little further down the track. Many thanks! Quote Link to comment Share on other sites More sharing options...
Wickham Posted February 29, 2012 Report Share Posted February 29, 2012 If the html file opens in IE, Chrome or Firefox it should open in Opera. Try right click.. Open With.. Opera Quote Link to comment Share on other sites More sharing options...
steamtronic Posted February 29, 2012 Author Report Share Posted February 29, 2012 If the html file opens in IE, Chrome or Firefox it should open in Opera. Try right click.. Open With.. Opera Working! Thank you! OK so my first lesson was "Dont write up webpages in MSWord". It's interesting that I haven't come across this advice in any of the noobie literature I've got my hands on so far. Anyhoo, thanks again Wickham. Quote Link to comment Share on other sites More sharing options...
CarlyG Posted March 1, 2012 Report Share Posted March 1, 2012 Save your files with .html or .htm extension (.html is more common than .htm) or save with .php extension if you have PHP code on the page that will need server processing (unlikely if you are a beginner). I am well aware that M$ Word adds a lot of junk which makes it un-usable for coding purposes, but... What's wrong with saving as .txt? I have used notepad++ for years, saving all my projects as .txt and never had an issue. Am I missing something obvious by saving all my files as .txt? :\ Quote Link to comment Share on other sites More sharing options...
Andrea Posted March 1, 2012 Report Share Posted March 1, 2012 When you open a txt file in a browser, all you see is the code. To see an actual website, you need to save the files as html, htm, php, ..... Quote Link to comment Share on other sites More sharing options...
LSW Posted March 1, 2012 Report Share Posted March 1, 2012 Hi Carly, a woman after my own heart... Long live "M$" users! Now if I could get out of the habit as I found myself doing it on my wife'e resume recently. Ooops. Quote Link to comment Share on other sites More sharing options...
benjaminmorgan Posted March 2, 2012 Report Share Posted March 2, 2012 If you save it as txt you can open it up but all you will see is plain unstyled text. If you save it as html you can style the markup with css Quote Link to comment Share on other sites More sharing options...
khanahk Posted August 3, 2012 Report Share Posted August 3, 2012 Notepad will get you through the night, but an Integrated Development Environment (IDE) will be your tool of choice as you progress. An IDE is just a really-fancy Notepad, with nice colors and 'indent-helping' and such for your code. Adobe Dreamweaver is a good one. 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.
Note: Your post will require moderator approval before it will be visible.