We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

Цей вебсайт матиме обмежену функціональність, доки ми проводимо його обслуговування для поліпшення роботи. Якщо прочитана стаття не розв'язала вашу проблему і ви хочете поставити питання, наша спільнота підтримки з радістю допоможе вам на @FirefoxSupport у Twitter та /r/firefox на Reddit.

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

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

  • 5 відповідей
  • 2 мають цю проблему
  • 10 переглядів
  • Остання відповідь від 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!

Усі відповіді (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.