Table of Contents
HTML Tutorial for Beginners
HTML is the preferred markup language for Web pages is HTML.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
HTML
1.Hyper Text Markup Language is what HTML stands for.
2.The preferred markup language for building Web pages is HTML.
3.HTML explains how a Web page is put together.
4.There are several different elements in HTML.
5.HTML elements identify different types of material, such as “this is a heading,” “this is a paragraph,” “this is a link,” etc.
Using Notepad or TextEdit, learn HTML
Step 1: Open Notepad (PC)
Windows 8
Launch the Start Menu (the window symbol at the bottom left on your screen). in Notepad.
Step 2: HTML Code
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Step 3: Save the HTML Page
On your PC, save the file.Select File > Save as in the Notepad menu.
Step 4:The HTML page can be viewed on your browser.
Open the HTML file you saved in your preferred browser (double click on the file, or right-click – and choose “Open with”).
HTML Headings
The H1 to H6 tags are used to define headings.
HTML Paragraphs
The <p> tag in HTML defines paragraphs:
HTML Links
The <a> tag is used to define links in HTML.
Also About:HTML
Elements
Nested Elements
Four HTML elements are used in the sample below (<html>
, <body>
, <h1>
and <p>)
Attributes
1.Every element in HTML can have attributes.
2.Additional information about elements is provided by attributes.
3.Always specify attributes in the start tag.
4.The standard format for attributes is name=”value”
href Attribute
A hyperlink is defined using the <a> tag.
src Attribute
An image can be included in an HTML page using the <img> tag.
Background Color
An HTML element’s background colour is specified through the CSS background-color attribute.
Styles – CSS
CSS Stands for Cascading Style Sheets (CSS) which is used to format a webpage’s design.
Hyperlinks
Hyperlinks are links in HTML.
HTML Tables
Web developers can organise data into rows and columns using HTML tables.
Block-level Elements
In an HTML document, a paragraph is defined by the <p> element.
Class Attribute
An HTML element’s class can be specified using the class attribute.
class Attribute:When referencing a class name in a style sheet, the class attribute is frequently utilised. HTML id Attribute
An HTML element’s distinctive id can be specified using the HTML id property.
Head Element
The following elements are contained in the HTML <head> element: <title>
, <style>
, <meta>
, <link>
, <script>
, and <base>
.
HTML <head> Element
Between the html and body tags, the <head> element serves as a container for metadata (info about data).
Data about the HTML document is known as HTML metadata. There is no display of metadata.
HTML <title> Element
The title of the document is specified via the title> element. The page’s tab or the title bar of the browser both display the title, which must only be text.
HTML documents must contain the <title> element!
The element title>:
1.It defines a title in the toolbar of the browser
2.It gives the page’s title when it is added to favourites.
3.It shows the page’s title in search engine results.