search
HomeWeb Front-endHTML TutorialIs the html file a plain text file?

Is the html file a plain text file?

Mar 04, 2021 pm 01:53 PM
html file

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.

Is the html file a plain text file?

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 is: Hyper Text Markup Language.
    "Hypertext" means that the page can contain pictures, links, and even non-text elements such as music and programs.
    "Markup Language" means a set of markup tags (Markup Tag).
  • HTML is not a programming language, but amarkup language (Markup Language).
  • HTML uses the tag tag to describe and define the content structure of the web page.

HTML tag:

  • HTML markup tag is usually Called HTML tag (HTML Tag).
  • HTML tags are keywords surrounded by angle brackets, such as .
  • HTML tags usually appear in pairs, such as

    and

    .
    The first tag of in tag pair is the starting tag , and the second tag of is the ending tag .
    This type of begins and ends with a tag that is presented, we generally call it "double tag".
  • Of course there are also tags presented separately, such as Is the html file a plain text file? etc.
    This type of tag presented alone is generally called "single tag" or "self-closing tag".
  • Generally Tags that appear in pairs (double tags), The content is in the middle of the two tags, such as:
    <h1 id="I-am-the-content-and-I-write-in-the-middle-of-the-double-label"> I am the content and I write in the middle of the double label. </h1> :
    ##【 Recommended tutorial: "html video tutorial
    "】

HTML document = web page


HTML Document description page.

HTML documents are also called web pages.

HTML documents contain HTML tags and plain text.
  1. The role of the browser relative to HTML documents:
  2. The role of the Web browser
is
reading HTML documents
, 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 needs to be written in
    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.
    • The final running result is to display the content of the page without displaying HTML tags.
    • Web browser display effect is as follows:


    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.

    Is the html file a plain text file?

    ##** .txt plain text file:**
      Now let’s
    • open the Notepad that comes with Windows And while writing
      , we found that during the writing process, cannot set color, underline and other styles for the text. .

    Is the html file a plain text 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 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:
    • Programming Video
    ! ! <p></p>

    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!

    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
    What is the difference between an HTML tag and an HTML attribute?What is the difference between an HTML tag and an HTML attribute?May 14, 2025 am 12:01 AM

    HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

    The Future of HTML: Evolution and TrendsThe Future of HTML: Evolution and TrendsMay 13, 2025 am 12:01 AM

    The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

    Why are HTML attributes important for web development?Why are HTML attributes important for web development?May 12, 2025 am 12:01 AM

    HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

    What is the purpose of the alt attribute? Why is it important?What is the purpose of the alt attribute? Why is it important?May 11, 2025 am 12:01 AM

    The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

    HTML, CSS, and JavaScript: Examples and Practical ApplicationsHTML, CSS, and JavaScript: Examples and Practical ApplicationsMay 09, 2025 am 12:01 AM

    The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

    How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

    Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

    What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

    HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

    How do you create a list in HTML?How do you create a list in HTML?May 06, 2025 am 12:01 AM

    TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

    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

    DVWA

    DVWA

    Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

    mPDF

    mPDF

    mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

    Atom editor mac version download

    Atom editor mac version download

    The most popular open source editor

    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.

    ZendStudio 13.5.1 Mac

    ZendStudio 13.5.1 Mac

    Powerful PHP integrated development environment