- How to create an HTML Document?
- Example
- Example
- Creating a complete document with head and body tag.
- Example
- How to Create a Simple Web Page with HTML
- Adding a Head to Your HTML
- Adding a Body and Text to Your HTML
- How to Write an HTML Page
- Preparing to Write
- Creating a Text Page
- Adding Links
- Adding Bullet Points
- Adding Images
- Saving the Document on Windows
- Saving the Document on Mac
- Community Q&A
How to create an HTML Document?
HTML stands for Hyper Text Markup Language. It is the most widely used language to write web page. HTML document defines the structure of web page.
HTML document begins with the declaration, and the HTML documents start and end with the and tags.
HTML document is split into two parts −
The head which contains the information about the document title etc. The information inside this tag does not display outside (on web page). The information of the head part is placed between
… tags.Example
Following is the example program for the head tag.
DOCTYPE html> html> head> title>HTML Articles-This is a title of the page title> head> body> body> html>
Following is the output for the head tag and the information inside the head tag does not display on the web page.
The information inside the head tag gets displayed in the title bar of the browser.
The body contains the content of the document, which gets displayed on your screen. The information of the body is placed in between
… tags.Example
Following is the example program for the body tag.
DOCTYPE html> html> body> p>The paragraph which are need to display on the web page are to be placed in between the paragraph tags.p> body> html>
On executing the above HTML code, the information inside the body tag gets displayed on the browser.
Creating a complete document with head and body tag.
Follow the steps to create HTML document.
- Open a text editor Notepad++.
- Write your HTML code into Notepad++.
- Save the file with .html extension.
- Run the file.
Example
Below is the structure of the HTML page.
DOCTYPE html> html> head> title>HTML Articlestitle> head> body> p>The paragraph which are need to display on the web page are to be placed in between the paragraph tags.p> body> html>
On executing the above program, the information about the head tags gets displayed on the title bar and, the information inside the body tag displayed on the browser.
How to Create a Simple Web Page with HTML
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions.
The wikiHow Tech Team also followed the article’s instructions and verified that they work.
This article has been viewed 4,543,027 times.
This wikiHow teaches you how to write a simple web page with HTML (hypertext markup language). HTML is one of the core components of the World Wide Web, making up the structure of web pages. Once you’ve created your web page, you can save it as an HTML document and view it in your web browser. Creating an HTML page is possible using basic text editors found on both Windows and Mac computers.
Adding a Head to Your HTML
Type in and press ↵ Enter . This tells the web browser that this is an HTML document. [1] X Research source
Type in and press ↵ Enter . This is the tag that opens your HTML head. The HTML head information that is not usually displayed on your web page. This information can include, the title, meta data, CSS style sheets, and other scripting languages. [2] X Research source
Type and press ↵ Enter . This is the tag to close your head. Your HTML code should look something like this.
html> head> title>My Web Pagetitle> head>
Adding a Body and Text to Your HTML
Type in below the closed «Head» tag. This tag opens the body of your HTML document. Everything that goes in the HTML body displays on the web page.
Type in . This is the tag to add a heading to your HTML document. A Heading is large bold text that typically goes at the top of your HTML document.
- Add additional headings as you go. There are six different headings that you can create by using the through tags. These create headings of different sizes. For example, to create three different-sized headings in succession, you might write the following:
h1>Welcome to My Page!h1> h2>My name is Bob.h2> h3>I hope you like it here.h3>
Type
. This is the tag to open a paragraph. Paragraph text is used to display normal sized text.
Type some text. This can be a description for your web page or any other information you wish to share.
Type
after your text and press ↵ Enter . This the tag to close your paragraph text. The following is an example of paragraph text in HTML:
- You can add multiple paragraph lines in a row in order to create a series of paragraphs under one heading.
- You can change the color of any text by framing the text with the and tags. Make sure to type your preferred color into the «color» section (you’ll keep the quotes). You can turn any text (e.g., headers) into a different color with this set of tags. For example, to turn a paragraph’s text blue, you would write the following code:
Whales are majestic creatures.
- You can add bolds, italics and other text formats using HTML. The following are examples of how you can format text using HTML tags: [3] X Research source
b>Bold textb> i>Italic texti> u>Underlined textu> sub>Subscript textsub> sup>Superscript textsup>
How to Write an HTML Page
This article was co-authored by wikiHow staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for wikiHow. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher.
The wikiHow Tech Team also followed the article’s instructions and verified that they work.
This article has been viewed 309,987 times.
This wikiHow teaches you how to create a webpage using HTML. Some elements of your webpage can include text, links, and images.
Preparing to Write
- For example, a paragraph is created by typing the open paragraph tag (
), entering the text that you want to use, and then entering a closed paragraph tag
.
- Each line of code must go on its own line, so you’ll normally press ↵ Enter after writing a line of code.
Consider learning about CSS. CSS is a language that acts as a complement to HTML; it covers page formatting (e.g., colors, centered text, etc.) and other visual aspects of the webpage.
Creating a Text Page
- Headers can be stacked throughout the page. For each header you use after the first one, just increase the number (e.g., for the second header, use ).
Repeat the header and paragraph process. You can add as many headers and paragraphs to your webpage as you like.
Add breaks in your page. Type in
Text and press ↵ Enter . This will create page gaps between your paragraphs if you want to space different parts out.
- text — Creates italic text.
- text — Creates bold text.
- text — Creates underlined text.
text— Creates text with a line through it.- text — Creates small text.
- — Creates invisible text. Used for adding notes to your webpage.
Close your document’s BODY and HTML tags. When you’re finished adding text, type in