html files are plain text files. HTML text is descriptive text composed of HTML commands and is a static web page file. HTML files can only write plain text when editing, and cannot directly style the text content like ".doc" documents.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
First: What is HTML
HTML is a language used to describe web pages.
HTML tag:
and
.<h1> I am the content and I write in the middle of the double label. </h1> :
HTML Document description page.HTML documents are also called web pages.
HTML documents contain HTML tags and plain text.
nbsp;html> <meta> <title>第一个网页</title> <h1>这是我的第一个网页</h1> <p>我一定会成为一名优秀的前端开发工程师。</p>
tag.2. Title, character encoding, compatibility, keywords, description and other information must be written in the
tag.
3. The content to be displayed on the web page must be written in the tag.
Although sometimes code written not according to standards can be displayed normally, as a professional quality, formal writing habits must be developed.
Document declaration header. Inform the browser which html version is used for writing (here is HTML5).
<p></p> Indicates to search engines that the page is in html language and the language is English.<h1></h1>
Title tag. Adds the semantics of a title to the text content. <p></p>
Paragraph tag. Adds the semantics of a paragraph to the text content. .
When the editor runs this code, the web browser will compile the HTML tag code and use the tags to explain the content of the page. Web browser display effect is as follows:
The meaning and difference between non-plain text files and plain text files: Non-plain text file (such as .doc): Non-plain text files (such as .doc):
OK Let’s get to know what a “plain text” file is:
The document format saved by Notepad is .txt format, which is the abbreviation of English text.
In terminology, this file is called: "Plain text file".
##** .txt plain text file:**
We did a small experiment, opened our word software, wrote a document and then saved it, and found that the saved document suffix format is .doc. In addition, during the writing process, we also discovered that the file .doc in this format can also set and save the text style. For example, the text can be blue or orange, and the text can also be underlined. And many more styles.
Now let’s
##Summary of the meaning and difference between non-plain text files and plain text files:
, we found that during the writing process, cannot set color, underline and other styles for the text. .
Difference:
Plain text file (such as .txt):
Plain text file (such as .txt):
Note: When .doc and .txt store the same content, .doc is larger than .txt (because it contains styles). Why do we first explain the meaning and difference between non-plain text files and plain text files?
Because:
! ! <p></p>
HTML files can only write plain text when editing. You will find that it cannot directly style text content like .doc documents!
We can do a small experiment, which is also the most classic experiment that proves that HTML is a plain text file:
We create a new Notepad.txt file on the computer desktop. Open it and write whatever you want. After the text content, press Ctrl S to save, and then close the file. Next step we forcibly change the .txt extension of the file to the .html extension. At this time, the .html file is a web page file. At this time, we use the browser to open it, and we find that the browser is completely The entire original content can be displayed normally!In this way, a .txt file is modified into a .html file, and until finally run using a browser, it is found that the entire content is displayed normally, which is enough to prove that HTML is a plain text file. !
In addition, we can also use Notepad to write HTML files, because HTML files are completely plain text files (but no one does this in actual development, here is just an explanation).
For more programming-related knowledge, please visit:
The above is the detailed content of Is the html file a plain text file?. For more information, please follow other related articles on the PHP Chinese website!