search
HomeWeb Front-endFront-end Q&AWhat is the extension of html files? What is the file type of the file?

There are two extensions for html files: "html" and "htm". An html file is a plain text file, a descriptive text composed of HTML commands, and a static web page file; an HTML file can only write plain text when editing, and cannot directly write text like a ".doc" document. Content styling.

What is the extension of html files? What is the file type of the file?

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

The full English name of HTML is Hyper Text Markup Language, which is translated into Chinese as "Hyper Text Markup Language" and is specially used to design and edit web pages.

Files written in HTML are called "HTML documents", and the general suffix is ​​.html (.htm can also be used, but it is rare). An HTML document is a plain text file that you can open or create using text editors such as Windows Notepad, Linux Vim, Notepad, Sublime Text, and VS Code.

HTML document = web page

  • HTML document describes the web page.

  • HTML documents are also called web pages.

  • HTML documents contain HTML tags and plain text.

HTML tags:

HTML is a markup language that uses various tags to format content. The characteristics of the tags are as follows:

  • HTML tags are composed of keywords surrounded by angle brackets, such as ;

  • ##With the exception of a few tags, most HTML tags appear in pairs , such as and ;

  • In tags that appear in pairs, the first tag is called the start tag, and the second tag is called the end tag ( closing tag).

Different tags in HTML have different meanings. Learning HTML is actually learning the meaning of each tag, and selecting appropriate tags according to the needs of the actual scenario to create beautiful web pages.


The role of the browser relative to HTML documents:
  • The role of the Web browserisRead HTML document , and display the content in the form of a web page.
  • Web browsers do not display the HTML tag , which uses tags to explain the content of the page .

  • HTML tag code is as follows:
nbsp;html>


    <meta>
    <title>第一个网页</title>


    <h1 id="这是我的第一个网页">这是我的第一个网页</h1>
    <p>我一定会成为一名优秀的前端开发工程师。</p>

Explanation of tag code in this example:

1. The description of the web page must be written in the

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).
  • Indicates to search engines that the page is in html language and the language is English.
  • Title tag. Adds the semantics of a title to the text content.
  • 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.

The final running result is to display the content of the page without displaying HTML tags.
The Web browser display effect is as follows:


What is the extension of html files? What is the file type of the file?

OK Let’s get to know what a “plain text” file is:
Windows comes with a software called Notepad.
  • 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
    ".
The meaning and difference between non-plain text files and plain text files:

** .doc non-plain text files:* *
  • 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.
  • ** .txt plain text file:**
    Now weopen the Notepad that comes with Windows and write, we find that during the writing process The text cannot be colored or underlined. .

What is the extension of html files? What is the file type of the file?

##Summary of the meaning and difference between non-plain text files and plain text files:

Meaning:

  • Non-plain text file (such as .doc):In addition to text, it can also set a variety of styles for the text .
  • Plain text file (such as .txt):It only has text and no style.

Difference:

  • Non-plain text files (such as .doc):It except It has the basic functions of writing text like plain text, and can also set and save text styles, such as saving text settings as different text colors, setting underlines for text, and many other styles.
  • Plain text file (such as .txt):In one sentence, it can only write text in a regular and honest manner, and cannot set text Any style.
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:
    HTML is plain text!
    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 are on the computer Create a new Notepad .txt file on the desktop. Open it and write any text content, then Ctrl S to save, and then close the file.

What is the extension of html files? What is the file type of the file?

Next step we forcefully change the .txt extension of the file to the .html extension. At this time, the .html file is a web page file

What is the extension of html files? What is the file type of the file?

What is the extension of html files? What is the file type of the file?

What is the extension of html files? What is the file type of the file?

At this time we use the browser to open it, and we find that the browser can display the original version normally All the content!

What is the extension of html files? What is the file type of the file?

In this way, I started to modify a .txt file into a .html file, until I finally ran it using the browser, I found that the entire content would be displayed normally, which is enough. 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:

Programming Video! !

The above is the detailed content of What is the extension of html files? What is the file type of the file?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
CSS: Can I use multiple IDs in the same DOM?CSS: Can I use multiple IDs in the same DOM?May 14, 2025 am 12:20 AM

No,youshouldn'tusemultipleIDsinthesameDOM.1)IDsmustbeuniqueperHTMLspecification,andusingduplicatescancauseinconsistentbrowserbehavior.2)Useclassesforstylingmultipleelements,attributeselectorsfortargetingbyattributes,anddescendantselectorsforstructure

The Aims of HTML5: Creating a More Powerful and Accessible WebThe Aims of HTML5: Creating a More Powerful and Accessible WebMay 14, 2025 am 12:18 AM

HTML5aimstoenhancewebcapabilities,makingitmoredynamic,interactive,andaccessible.1)Itsupportsmultimediaelementslikeand,eliminatingtheneedforplugins.2)Semanticelementsimproveaccessibilityandcodereadability.3)Featureslikeenablepowerful,responsivewebappl

Significant Goals of HTML5: Enhancing Web Development and User ExperienceSignificant Goals of HTML5: Enhancing Web Development and User ExperienceMay 14, 2025 am 12:18 AM

HTML5aimstoenhancewebdevelopmentanduserexperiencethroughsemanticstructure,multimediaintegration,andperformanceimprovements.1)Semanticelementslike,,,andimprovereadabilityandaccessibility.2)andtagsallowseamlessmultimediaembeddingwithoutplugins.3)Featur

HTML5: Is it secure?HTML5: Is it secure?May 14, 2025 am 12:15 AM

HTML5isnotinherentlyinsecure,butitsfeaturescanleadtosecurityrisksifmisusedorimproperlyimplemented.1)Usethesandboxattributeiniframestocontrolembeddedcontentandpreventvulnerabilitieslikeclickjacking.2)AvoidstoringsensitivedatainWebStorageduetoitsaccess

HTML5 goals in comparison with older HTML versionsHTML5 goals in comparison with older HTML versionsMay 14, 2025 am 12:14 AM

HTML5aimedtoenhancewebdevelopmentbyintroducingsemanticelements,nativemultimediasupport,improvedformelements,andofflinecapabilities,contrastingwiththelimitationsofHTML4andXHTML.1)Itintroducedsemantictagslike,,,improvingstructureandSEO.2)Nativeaudioand

CSS: Is it bad to use ID selector?CSS: Is it bad to use ID selector?May 13, 2025 am 12:14 AM

Using ID selectors is not inherently bad in CSS, but should be used with caution. 1) ID selector is suitable for unique elements or JavaScript hooks. 2) For general styles, class selectors should be used as they are more flexible and maintainable. By balancing the use of ID and class, a more robust and efficient CSS architecture can be implemented.

HTML5: Goals in 2024HTML5: Goals in 2024May 13, 2025 am 12:13 AM

HTML5'sgoalsin2024focusonrefinementandoptimization,notnewfeatures.1)Enhanceperformanceandefficiencythroughoptimizedrendering.2)Improveaccessibilitywithrefinedattributesandelements.3)Addresssecurityconcerns,particularlyXSS,withwiderCSPadoption.4)Ensur

What are the main areas where HTML5 tried to improve?What are the main areas where HTML5 tried to improve?May 13, 2025 am 12:12 AM

HTML5aimedtoimprovewebdevelopmentinfourkeyareas:1)Multimediasupport,2)Semanticstructure,3)Formcapabilities,and4)Offlineandstorageoptions.1)HTML5introducedandelements,simplifyingmediaembeddingandenhancinguserexperience.2)Newsemanticelementslikeandimpr

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft