Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

En savoir plus

Firefox won't open my local html files as webpages, just shows the html code. Why?

  • 5 réponses
  • 2 ont ce problème
  • 10 vues
  • Dernière réponse par cor-el

more options

I'm trying to set up a very basic website, and just to test some things out, cut and pasted a one-line website from W3schools.com. It was just an introductory HTML page. I saved it in TextEdit as an .html file and tried to open it in Firefox. However, Firefox opened it but instead of displaying as a web page, just displayed the html coding. Then I tried it in Safari, but it does the same thing. What's going on here? How can I develop pages if I can't even see what I'm doing?

Thanks!

I'm trying to set up a very basic website, and just to test some things out, cut and pasted a one-line website from W3schools.com. It was just an introductory HTML page. I saved it in TextEdit as an .html file and tried to open it in Firefox. However, Firefox opened it but instead of displaying as a web page, just displayed the html coding. Then I tried it in Safari, but it does the same thing. What's going on here? How can I develop pages if I can't even see what I'm doing? Thanks!

Toutes les réponses (5)

more options

Hi Karin, when you open a file from disk, Firefox may need an extra clue that it is an HTML file. In particular:

- Did you give the file name a .html extension? - Does the file have the typical tags around the content that you're experimenting with:

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Page Title</title> </head> <body> Your content here </body> </html>

more options

Sorry, you did mention adding an .html extension.

Maybe this is a peculiar behavior of TextEdit. Try this: save any web page to the folder where you are editing, and then open the web page in TextEdit and replace its content with the content of your example website and save the file. Hopefully then it will be recognized as an HTML file.

If not, you could try a better editor or seek help on Apple's forums.

more options

Thanks, I tried that and it just shows a whole page full of html code (from the example site).

I have no idea what's going on.

more options

Can your Firefox open other saved .html files successfully? In case this is not a problem caused by TextEdit...

more options

Did you try to save the page in Firefox as an HTML file?

Do pages that you save from internet load properly?

Did you check your security software?

Did you make sure that the servers sends the file as text/html in case you aren't loading the file directly in Firefox, but load the file via localhost?

Also make sure that you have HTML tags and not entities (&lt; and &gt;) in the file.