Step by step html code

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

Image titled 4082 1 2

Windows Start

Mac Spotlight

Image titled 4082 2 2

Type in and press ↵ Enter . This tells the web browser that this is an HTML document. [1] X Research source

Image titled 4082 3 2

Image titled 4082 4 2

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

Image titled 4082 5 2

Image titled 4082 6 2

Image titled 4082 7 2

Image titled 4082 8 2

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

Image titled 4082 9 2

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.

Image titled 4082 10 2

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.

Image titled 4082 11 2

Image titled 4082 12 2

    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> 

Image titled 4082 13 2

Type

. This is the tag to open a paragraph. Paragraph text is used to display normal sized text.

Image titled 4082 14 2

Type some text. This can be a description for your web page or any other information you wish to share.

Image titled 4082 15 2

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> 

Источник

HTML beginner’s tutorial: Build a webpage from scratch with HTML

If you are a web dev novice and want to get started with the exciting world of web design, you’ve probably heard of HTML, which is the foundation of every web page online. Any successful web developer or designer must have a strong understanding of HTML.

Today, we will go through a beginner’s tutorial on HTML and build a web page step-by-step. Most web development tutorials talk about CSS and JavaScript right away, but we want to make sure you have a solid understanding of HTML before moving onto the next steps.

We will discuss the basics of HTML that you’ll use throughout your web dev career. No prerequisite knowledge of programming is required, but to be most successful with this article, a basic understanding of programming is helpful. For a quick introduction or refresher, check out The Absolute Beginner’s Guide to Programming.

Today we will cover:

Become a frontend developer for free.

The ideal place to start your journey as a front-end developer. With no prior knowledge needed, you will gain a mastery of HTML, CSS, and JavaScript.

What is HTML?

Hyper Text Markup Language (HTML) is the markup language we use to make webpages. It is the basis of every website that you encounter on the internet. Think of HTML as the bricks that you need to build anything for the web. Once we write our HTML code, we can add other languages to the page, such as CSS and JavaScript, to add interactivity, style, and more.

Imagine a document that you would create in a word processor. That document will usually use different font sizes to indicate sections of the text, such as headers, main content, footers, table of contents, etc. HTML is the process of building that document and setting the sizes of our text.

HTML provides a website’s structure and layout. We define that structure using various elements. But in order for a browser to appear how we want it, it must be explicitly told what each piece of content is. HTML is how we communicate and tell a computer how to render. The computer can interpret our HTML elements and translate them onto the screen.

Explore HTML on your own.

You can view the HTML source code of any website by right clicking on a rendered page and selecting “View Source”. This will open a page that details the HTML foundations of that site. Try it out with this article!

Key HTML terms and formatting

Now that we know what HTML is, let’s briefly introduce a few key terms before moving onto a step-by-step guide. You will use these basics throughout your entire web dev career!

Tags and elements

An element is an individual component of an HTML document that represents the semantics of that page. For example, the title element translates to the title of a page.

Semantics refers to the meaning of a particular element. Syntax refers to the structure of a programming language.

To create an element, we use tags. Think of these as descriptors for each piece of content you want on your page. Most tags are quite self-explanatory.

  • : used to describe a paragraph

  • : add an image
  • : set the text to the largest size heading
  • : an anchor will create a hyperlink to other HTML files

To use tags, we wrap the content between an opening and closing tag. The closing tag uses the forward slash / , while the opening tag does not. HTML tags are case not sensitive so is the same as

.

 

This is a paragraph element.

You can nest HTML elements when you want to apply multiple tags. Say you wanted to make a paragraph that is also bold. You could write the following HTML code:

HTML attributes provide additional information about our elements. Think of these like properties of an element. Attributes are placed in the opening tag, use the = sign, and wrap the attribute value in quotation marks » » .

Attributes can do all sorts of things to our elements such as embed images, add color, declare the language of a page, or add a title. For example, we can add color to our text using the following format.

Note: You can add color using Hex color codes (for specific colors) or one of the 140 text color names built-into HTML.

One of the most common uses of attribute is hyperlinking. We can connect any HTML page to another HTML page using an anchor tag. The href attribute will create a connection between the two sites.

Headings and lists

Headings are how we specify the difference between the main header and sub-headers. The HTML standard has six text heading elements, appropriately named h1 (the largest) through h6 (the smallest).

Note: Headers are used to represent text semantically. This is different than specifying font size. We use CSS to change font size.

Оцените статью