Arad olfati
Arad olfati

Reputation: 3

why we can't use text file instead of html file for web pages?

as you know txt files and HTML files are text-based documents and I want to know why we use .HTML extension? I mean both of them (text and HTML files) are text-based but when I open txt file, my browser can't render it. help me, please.

Upvotes: 0

Views: 670

Answers (1)

Quentin
Quentin

Reputation: 944172

The .txt extension indicates a plain text file. HTML is text based, but it isn't plain text, it is formatted with HTML.

Software uses file extensions (or Content-Type headers if we're using HTTP) to determine how to treat a file.

Upvotes: 1

Related Questions