HTML Programming

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6
At a glance
Powered by AI
HTML is the standard markup language used to create web pages. It uses tags to define headings, paragraphs, lists and other elements on web pages. A web browser reads HTML documents and displays them as rendered web pages.

HTML tags are keywords surrounded by angle brackets that are used to define headings, paragraphs, lists and other elements in a web page. Common tags include <html>, <head>, <body>, <p>, <h1>-<h6> and they normally come in pairs with opening and closing tags. Tags are not visible on rendered web pages but are used by browsers to interpret the content.

<b> and <i> are used to bold and italicize text. <strong> and <em> are used to emphasize important text. <br> inserts a line break. There are also tags for computer code, citations and definitions.

HTML Programming Introduction

HTML, which stands for HyperText Markup Language, is the predominant markup languagefor web pages. HTML is the basic building-blocks of webpages. HTML is written in the form of HTML elements consisting of tags, enclosed in angle brackets(like <html>), within the web page content. HTML tags normally come in pairs like <h1> and </h1>. The first tag in a pair is the start tag, the second tag is the end tag (they are also calledopening tags and closing tags). In between these tags web designers can add text, tables, images, etc. The purpose of a web browser is to read HTML documents and compose them into visual or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts in languages such as JavaScript which affect the behavior of HTML webpages. Web browsers can also refer to Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. The W3C, maintainer of both the HTML and the CSS standards, encourages the
[1]

use of CSS over explicitly presentational HTML markup. What is HTML?


HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup language A markup language is a set of markup tags HTML uses markup tags to describe web pages

HTML Tags
HTML markup tags are usually called HTML tags HTML tags are keywords surrounded by angle brackets like <html> HTML tags normally come in pairs like <b> and </b> The first tag in a pair is the start tag, the second tag is the end tag Start and end tags are also called opening tags and closing tags

HTML Documents = Web Pages


HTML documents describe web pages HTML documents contain HTML tags and plain text HTML documents are also called web pages

The purpose of a web browser (like Internet Explorer or Firefox) is to read HTML documents and display them as web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page:

Formatting Text-Forms & Formulating Elements


HTML uses tags like <b> and <i> for formatting output, like bold or italic text. These HTML tags are called formatting tags Often <strong> renders as <b>, and <em> renders as <i>. However, there is a difference in the meaning of these tags: <b> or <i> defines bold or italic text only. <strong> or <em> means that you want the text to be rendered in a way that the user understands as "important". Today, all major browsers render strong as bold and em as italics. However, if a browser one day wants to make a text highlighted with the strong feature, it might be cursive for example and not bold!

HTML Text Formatting Tags

These are the tags for text formats:

HTML "Computer Output" Tags

HTML Citations, Quotations, and Definition Tags

Formatting FormsHTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can also contain select lists, textarea, fieldset, legend, and label elements. The <form> tag is used to create an HTML form:

<form> . input elements . </form>

HTML Forms - The Input Element


The most important form element is the input element. The input element is used to select user information. An input element can vary in many ways, depending on the type attribute. An input element can be of type text field, checkbox, password, radio button, submit button, and more. The most used input types are described below.

Text Fields
<input type="text" /> defines a one-line input field that a user can enter text into:

<form> First name: <input type="text" name="firstname" /><br />Last name: <input type="text" name="lastname" /></form>

How the HTML code above looks in a browser

Note: The form itself is not visible. Also note that the default width of a text field is 20 characters.

Password Field

<input type="password" /> defines a password field:

<form> Password: <input type="password" name="pwd" /></form>

How the HTML code above looks in a browser

Note: The characters in a password field are masked (shown as asterisks or circles).

You might also like