Table of Contents
HTML is the code that most web pages are built on. It’s how to Write HTML Code we tell browsers to organize content into paragraphs, headings, images, links, lists, forms, tables, buttons, and more. HTML is a great place to start if you want to build a website, do web development, or learn how to code in general.
In this HTML guide for beginners, we’ll learn what HTML is and how it can be used. Then, we’ll go over some of HTML’s most important elements and attributes and show you how to write some basic HTML. We’ll end by taking a quick look at a few places you can go to keep learning and using HTML.
How to Write HTML Code
Creating and Saving a New HTML Document
Open a text editor. You can use any text editor that came pre-installed on your system to write HTML. On Windows, you can open Notepad. On Mac, open TextEdit. Use the following steps to open a text editor:
- Windows:
- Click the Windows Start icon.
- Type “Notepad”.
- Click Notepad.
- Mac:
- Click the magnifying glass in the upper-right corner.
- Type “TextEdit” in the search bar and press Enter.
- Click New Document.
- Type at the tip of the page. This tag tells the web browser that the document type is an HTML document.
- Click File. It’s in the menu bar at the top.
- Click Save as. It’s in the “File” menu.
- Type a name for the document. You will want to create a separate HTML document for each web page of your websites. On many websites, the front page is titled “index.html”, but you can name it anything you want. Enter the file name you want to name the document next to “File name”.
- Click Save. This saves the document as an HTML document. From now on, if you need to save your work, just click File followed by Save.
Writing Text
- Type <h1> in the Body to add a header. All the contents of your HTML document are going to go between the “<body>” and “</body>” tags. The “<h1>” tag is the opening tag to write a header.
- Write a heading after the header tag. The text your write after the “
- ” tag will appear in a large header format. If you want the title of your page to appear at the top in large letters, write “
- Type </h1> to close the header tag. Unless you want the entire text of your HTML document to appear in the header format, you’ll want to close the header tag. Type “</h1>” after your header text to close the header.
- Type
to add a line break. If you want to add a space after some text, type “
“. This creates a break in the text and adds another line. You can type the “
” tag for as many lines as you need. The line break tag is one of the few HTML tags that doesn’t require a closing tag. - Type <p> to add paragraph text. When you want to add paragraph text in HTML, use the “<p>” tag as the opening for the paragraph text.
- Type your paragraph text. Any text you type after the “<p>” tag will be formatted as paragraph text. You can add as much text as you need.
- Type </p> to close the paragraph text. When you are done writing your paragraph text, use the “</p>” tag to close the “<p>” paragraph tag.
- Adding a list. You can add a numbered or bulleted list to your HTML. Use the following steps to add a list to your HTML
What is HTML?
Tim Berners-Lee, Robert Cailliau, and others made HTML for the first time in 1989. Hyper Text Markup Language is what it stands for. Hypertext means that the document has links that take the reader to other parts of the same document or to a completely different document. HTML5 is the most up-to-date version.
A Markup Language is a way for computers to talk to each other and tell each other how to handle and show text. Tags and attributes are used in HTML to do this. Okay, so this is the only part of theory that you have to know. It helps to know what you are doing before you start writing HTML.
What is HTML used for?
HTML is most often used to make web pages. HTML is free to use and makes sure that your text, images, and other elements look the way you want them to. With HTML, you can add headings, paragraphs, lists, and other elements to your page.
You can also embed images, videos, audio files, and other multimedia. You can also link to other pages on the same site or on a different site. This makes it easy for people to move around your website and switch between sites.