HTML
HTML is the standard markup language for Web pages. With HTML, you can create the structure of any website.
Elements
HTML documents consist of elements. There are several HTML elements like heading, lists, and links. HTML elements are defined by a start tag, some content, and an end tag just like so:
Attributes
HTML attributes provide additional information about HTML elements. All HTML elements can have attributes. Attributes provide additional information about elements. They are always specified in the start tag and usually come in name/value pairs like: name="value"
Example: The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to:
Headings
HTML headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading and <h6> defines the least important heading.
Example:
Paragraphs
The HTML <p> element defines a paragraph. A paragraph always starts on a new line, and is usually a block of text.
Example:
Images
The HTML <img> tag is used to embed an image in a web page. The <img> tag has two required attributes:
src - Specifies the path to the image
alt - Specifies an alternate text for the image
Example:
Links
The HTML <a> tag defines a hyperlink. It has the following syntax:
The most important attribute of the <a> element is the href attribute, which indicates the link's destination. The link text is the part that will be visible to the reader - when they click on this text, they will be taken to the link.
Lists
There are two types of lists: unordered lists and ordered lists.
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. This will create a list with bullet points.
Example:
An ordered list starts with the <ol> tag. Each list item starts with the <li> tag. This will create a numbered list
Example:
Forms
A HTML form is used to collect user input. The user input can then be sent to a server for processing. The HTML <form> element is used to create an HTML form for user input.
Example:
Form Elements
Form elements are different types of input elements like: text fields, check boxes, radio buttons, submit buttons, and more. The <input> element is the most important form element. An <input> element can be displayed in many ways, depending on the type attribute.
For Example:
<input type="text"> Displays a single-line text input field <input type="radio"> Displays a radio button (for selecting one of many choices) <input type="submit"> Displays a submit button (for submitting the form)
Example of a full form:
Block and Inline Elements
A block-level element always starts on a new line and takes up the full width available. The most famous block element in HTML is <div>. We usually use div elements to wrap sections of a document.
An inline element does not start on a new line and it only takes up as much width as necessary. The most famous inline element in HTML is <span> which is very similar to the div element but we use to wrap a small portions of text, images, etc.
To learn about more HTML, visit https://www.w3schools.com/html/default.asp
Last updated