search
HomeWeb Front-endJS TutorialDevelop yourself to build Web UIs: Part Understanding HTML

Web Development is one of the most in-demand skills today. It involves creating user-friendly and engaging websites that can be accessed via a browser. The first step in becoming a web developer is understanding HTML.

Develop yourself to build Web UIs: Part  Understanding HTML

HTML (Hyper Text Markup Language) is the backbone of any web page. It’s the standard language used to structure a webpage, determining how content is displayed in browser. While the appearance of a page is decided by CSS (Cascading Style Sheets) and its functionality by JS (Javascript), HTML is responsible for the fundamental skeleton or structure.

Before diving in this part of the course, it’s important to understand famous and recurring jargons that will be used in your journey. These will help you understand the concepts as we progress (and also make it easy for the author to explain things ;-) ).


Understanding the Jargons

  1. Programming Language: A set of instructions written in a specific syntax (way of a programming language) that a computer can execute. Remember the computer understands only binary code (either 1 or 0), now, in order to make the computer understand the logic and also to find a trade-off, we (humans), have created a programming language such that it is easy for us to code and also for the computer to understand it.
  2. Compiler: A tool that translates code written in a programming language into machine language that a computer can understand and execute.
  3. Syntax: The rules that define the structure of a programming language. Think of it as the way words are arranged in a sentence to make sense.
  4. Comments: Notes within the code that explain what certain parts of the code do. Comments help other developers (or your future self) understand the logic behind your code.
  5. DOM (Document Object Model): The DOM is a tree-like representation of the HTML document. Every tag in your HTML becomes a node in this tree. For example, if your HTML has a tag with a

    (paragraph) inside it, the browser creates a body node with a paragraph node as its child.

  6. Children: You will understand this as you progress. Elements nested within another element. For example, in HTML, a paragraph tag (

    ) within a div tag (

    ) would be considered a child of the div.
  7. Block-level element: You will be introduced to this jargon as you progress. This term usually describes the feature of the element that it will be taking the full available width.

  8. Firing up with HTML

    HTML stands for Hyper Text Markup Language

    • Hyper Text: Refers to the ability of HTML to link different documents together.

    • Markup Language: Uses tags to annotate text, defining how it should be displayed in a browser.

    Here’s the basic structure of an HTML document:

    
      
        <title>HTML Tutorial</title>
      
      
        <p>Hello, world!</p>
      
    
    
    • Tags: In HTML, tags are used to define elements. Tags are enclosed in angle brackets, like or

      .

    • Elements: Consist of an opening tag and a closing tag, which may contain content. For example,

      Hello, world!

      is a paragraph element.

    HTML Document Structure

    Every HTML document follows a basic structure:

    1. : Declares the document type and version of HTML.
    2. : The root element that encloses all other HTML elements.
    3. : Contains meta-information about the document, such as the title and links to stylesheets.
    4. : Sets the title of the webpage, displayed in the browser's title bar or tab.
    5. : Provides metadata about the HTML document, such as character set, author, and viewport settings. It's a self-closing tag.
    6. : Embeds CSS code to style the HTML elements.
    7. <script></script>: Embeds JavaScript code for adding interactivity to the webpage.
    8. : Encloses the content that will be visible to users on the webpage.

    Commonly Used HTML Elements

    Here are some basic HTML elements you’ll use frequently:

    • : Defines a paragraph.
    • : A block-level element used to group other elements together.
    • : An inline element used to group text for styling purposes.
    • : Represents the introductory content or navigational links of a section.
    • to
      : Headings, with

      being the highest level and

      the lowest.

    • : Inserts a line break (self-closing tag — meaning there is no need to close the tag).
    • : Used to create an HTML form for user input.
    • : Creates an input field, typically used within a form.
    • : Creates a dropdown list.
    • : Associates a text label with a form element.
    • : Defines a table.
    • : Defines a row in a table.
    • : Defines a cell in a table row.
    • : Defines a header cell in a table row.
      • : Defines an unordered (bulleted) list.
        1. : Defines an ordered (numbered) list.
        2. : Defines a list item.

        Creating Your First HTML File

        To create an HTML file, you can use any text editor, such as Notepad or VS Code. Here’s a simple example:

        1. Open your text editor and type the following code:
        
        
          <title>HTML Tutorial</title>
        
        
          <h1 id="Example-Number">Example Number 1</h1>
          <p>Hello, world!</p>
        
        
        
        1. Save the file with a .html extension (e.g., index.html)
        2. Open the file in your web browser to see your first HTML webpage in action!
        3. To inspect your code, press Ctrl + Shift + C in Google Chrome to open the Developer Tools and explore the DOM structure.
        4. Go to the network tab in the Developer Tools and refresh your browser tab.

        You can find that there is a request in the name that you have saved as in this picture.
        Develop yourself to build Web UIs: Part  Understanding HTML

        In the response tab, you will find the code that you have written as in the following picture
        Develop yourself to build Web UIs: Part  Understanding HTML

        Now, what happened is that, once you opened the file you have saved as html, the computer began running the file in browser. The browser wanted something to show, so it made a request call to the file from which it was launched. The file gave the browser your code and that was found in the response section. Since it was a html file, the browser begins reading the HTML code from the top to the bottom. This process is known as parsing. During parsing, the browser encounters different HTML tags (like ,

        , , etc.) and starts to build a structure called DOM based on these tags. As the browser builds the DOM, it simultaneously renders the content on your screen.

        Creating a Table

        Let’s take a step further by creating a simple table in HTML:

        1. Open the same HTML file and add the following code inside the tag:
        <p>Table Example</p>
        
        Name Power Is Kurama Present
        Naruto Rasengan Yes
        Sasuke Sharingan No
        1. Save the file and refresh your browser to see the table displayed.

        Notice the heading is being rendered by paragraph tag. Alternatively, you can also use

        tag, which will center the heading of the table. Experiment with the caption tag and refresh to see the changes.

        Note that

        tag should only be used immediately after the opening tag.

        You’ve now successfully created a basic table in HTML. Feel free to experiment with additional rows and columns to get more comfortable with HTML syntax.


        Conclusion

        Congratulations on completing your first steps into web development with HTML! The key to mastering HTML is practice. Experiment with different elements, create your own webpages, and don’t be afraid to make mistakes — every error is a learning opportunity.

        Remember, this is just the beginning. As you continue to build on this foundation, you’ll soon be able to create more complex and dynamic websites. Let’s make the web a better place, one line of code at a time.

        This article is written by Anantha Krishnan, a professional with experience in both IT and Mechanical Engineering. With a background in full stack development and a passion for mechanical and electrical systems, Anantha Krishnan is now focused on creating educational content to help beginners in fields of his expertise.

      The above is the detailed content of Develop yourself to build Web UIs: Part Understanding HTML. 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
      Python vs. JavaScript: A Comparative Analysis for DevelopersPython vs. JavaScript: A Comparative Analysis for DevelopersMay 09, 2025 am 12:22 AM

      The main difference between Python and JavaScript is the type system and application scenarios. 1. Python uses dynamic types, suitable for scientific computing and data analysis. 2. JavaScript adopts weak types and is widely used in front-end and full-stack development. The two have their own advantages in asynchronous programming and performance optimization, and should be decided according to project requirements when choosing.

      Python vs. JavaScript: Choosing the Right Tool for the JobPython vs. JavaScript: Choosing the Right Tool for the JobMay 08, 2025 am 12:10 AM

      Whether to choose Python or JavaScript depends on the project type: 1) Choose Python for data science and automation tasks; 2) Choose JavaScript for front-end and full-stack development. Python is favored for its powerful library in data processing and automation, while JavaScript is indispensable for its advantages in web interaction and full-stack development.

      Python and JavaScript: Understanding the Strengths of EachPython and JavaScript: Understanding the Strengths of EachMay 06, 2025 am 12:15 AM

      Python and JavaScript each have their own advantages, and the choice depends on project needs and personal preferences. 1. Python is easy to learn, with concise syntax, suitable for data science and back-end development, but has a slow execution speed. 2. JavaScript is everywhere in front-end development and has strong asynchronous programming capabilities. Node.js makes it suitable for full-stack development, but the syntax may be complex and error-prone.

      JavaScript's Core: Is It Built on C or C  ?JavaScript's Core: Is It Built on C or C ?May 05, 2025 am 12:07 AM

      JavaScriptisnotbuiltonCorC ;it'saninterpretedlanguagethatrunsonenginesoftenwritteninC .1)JavaScriptwasdesignedasalightweight,interpretedlanguageforwebbrowsers.2)EnginesevolvedfromsimpleinterpreterstoJITcompilers,typicallyinC ,improvingperformance.

      JavaScript Applications: From Front-End to Back-EndJavaScript Applications: From Front-End to Back-EndMay 04, 2025 am 12:12 AM

      JavaScript can be used for front-end and back-end development. The front-end enhances the user experience through DOM operations, and the back-end handles server tasks through Node.js. 1. Front-end example: Change the content of the web page text. 2. Backend example: Create a Node.js server.

      Python vs. JavaScript: Which Language Should You Learn?Python vs. JavaScript: Which Language Should You Learn?May 03, 2025 am 12:10 AM

      Choosing Python or JavaScript should be based on career development, learning curve and ecosystem: 1) Career development: Python is suitable for data science and back-end development, while JavaScript is suitable for front-end and full-stack development. 2) Learning curve: Python syntax is concise and suitable for beginners; JavaScript syntax is flexible. 3) Ecosystem: Python has rich scientific computing libraries, and JavaScript has a powerful front-end framework.

      JavaScript Frameworks: Powering Modern Web DevelopmentJavaScript Frameworks: Powering Modern Web DevelopmentMay 02, 2025 am 12:04 AM

      The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

      The Relationship Between JavaScript, C  , and BrowsersThe Relationship Between JavaScript, C , and BrowsersMay 01, 2025 am 12:06 AM

      Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr

      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 Tools

      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

      Dreamweaver Mac version

      Dreamweaver Mac version

      Visual web development tools

      SublimeText3 Linux new version

      SublimeText3 Linux new version

      SublimeText3 Linux latest version

      EditPlus Chinese cracked version

      EditPlus Chinese cracked version

      Small size, syntax highlighting, does not support code prompt function