Dachshund_Decals Posted March 14, 2022 Share Posted March 14, 2022 (edited) Hello everyone. It has been several years since I did any coding so please be kind. In the very first tutorial we can copy the first bit of code into notepad (I also try saving it in MS Word), save as html document and open it in xyz browser. All that shows on the page is the very text (code) that is in the file. <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> I don't see any problem with this code. Do I need to do something to the browsers? Edited March 14, 2022 by Dachshund_Decals misspelled word Link to comment Share on other sites More sharing options...
Ingolme Posted March 15, 2022 Share Posted March 15, 2022 If you use MS Word, Wordpad or other rich text editors it won't work. It needs to be in plain notepad or a code editor. The file needs to be saved with a .html extension instead of .txt. Windows sometimes hides file extensions, so it is possible that your file is saved as ".html.txt" which wouldn't work. Link to comment Share on other sites More sharing options...
Dachshund_Decals Posted March 15, 2022 Author Share Posted March 15, 2022 Thanks for the reply. For some reason, the only way I can save the file as index.htm is in Word. Notepad insists on adding the .txt, even when "All Files (*.*) is selected. I'm running W10 64 bit on my PC (if that matters) Link to comment Share on other sites More sharing options...
Ingolme Posted March 15, 2022 Share Posted March 15, 2022 Notepad lets you choose an extension. When you select "Save As..", there's a dropdown at the bottom of the save window named "Save as type". If you select "All files (*.*)" you can set the extension to .html Link to comment Share on other sites More sharing options...
dsonesuk Posted March 15, 2022 Share Posted March 15, 2022 You should also save as UTF-8. Link to comment Share on other sites More sharing options...
Dachshund_Decals Posted March 15, 2022 Author Share Posted March 15, 2022 (edited) Thanks for the reply. It is also saved with UTF-8 selected. Edited March 15, 2022 by Dachshund_Decals repeated verbiage Link to comment Share on other sites More sharing options...
Dachshund_Decals Posted March 15, 2022 Author Share Posted March 15, 2022 I think I found the issue; it's in Notepad itself. Correct me if I'm wrong; when "all files" is selected, should there not be a list of file types to choose from? If so, my Notepad is broken because there isn't a list. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 15, 2022 Share Posted March 15, 2022 All files should list folders and files IF! available at the location chosen. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 16, 2022 Share Posted March 16, 2022 Unless? the problem is that file extensions are set as hidden by default by windows explorer not Notepad. View -> make sure 'file name extensions' is checked. Link to comment Share on other sites More sharing options...
Ingolme Posted March 16, 2022 Share Posted March 16, 2022 On 3/15/2022 at 8:58 AM, Dachshund_Decals said: I think I found the issue; it's in Notepad itself. Correct me if I'm wrong; when "all files" is selected, should there not be a list of file types to choose from? If so, my Notepad is broken because there isn't a list. No, there is no list of file types, you just have to manually type the extension in the filename itself. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now