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!

Este site está com funcionalidades limitadas enquanto realizamos manutenção para melhorar sua experiência de uso. Se nenhum artigo resolver seu problema e você quiser fazer uma pergunta, nossa comunidade de suporte pode te ajudar em @FirefoxSupport no Twitter e /r/firefox no Reddit.

Pesquisar no site de suporte

Evite golpes de suporte. Nunca pedimos que você ligue ou envie uma mensagem de texto para um número de telefone, ou compartilhe informações pessoais. Denuncie atividades suspeitas usando a opção “Denunciar abuso”.

Saiba mais

Esta discussão foi arquivada. Faça uma nova pergunta se precisa de ajuda.

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

  • 5 respostas
  • 2 têm este problema
  • 10 visualizações
  • Última resposta de 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!

Todas as respostas (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.