Jump to content

browsers won't display properly


Dachshund_Decals

Recommended Posts

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 by Dachshund_Decals
misspelled word
Link to comment
Share on other sites

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

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

 

save-as.png

 

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...