!doctype HTML Head Title /title /head Body h1 /h1 P /P /body /HTML
HTML is a markup language used to define the structure and layout of web pages. HTML uses tags like <h1> and <p> to mark up different parts of a web page like headings and paragraphs. The <head> tag contains metadata about the page while the <body> contains the visible page content. Common HTML tags are used to change text styling and formatting.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
52 views
!doctype HTML Head Title /title /head Body h1 /h1 P /P /body /HTML
HTML is a markup language used to define the structure and layout of web pages. HTML uses tags like <h1> and <p> to mark up different parts of a web page like headings and paragraphs. The <head> tag contains metadata about the page while the <body> contains the visible page content. Common HTML tags are used to change text styling and formatting.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
What is HTML?
HTML is a markup language for describing web documents (web pages).
HTML stands for Hyper Text Markup Language A markup language is a set of markup tags HTML documents are described by HTML tags Each HTML tag describes different document content A Small HTML Document Example <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> Try it Yourself Example Explained The <!DOCTYPE html> declaration defines this document to be HTML5 The text between <html> and </html> describes an HTML document The text between <head> and </head> provides information about the document The text between <title> and </title> provides a title for the document The text between <body> and </body> describes the visible page content The text between <h1> and </h1> describes a heading The text between <p> and </p> describes a paragraph Using this description, a web browser will display a document with a heading and a paragraph HTML Tags HTML tags are keywords (tag names) surrounded by angle brackets: <tagname>content goes here...</tagname> HTML tags normally come in pairs like <p> and </p> The first tag in a pair is the start tag, the second tag is the end tag The end tag is written like the start tag, but with a forward slash inserted before the tag name The start tag is also called the opening tag, and the end tag the closing tag. Headings Are Important Search engines use the headings to index the structure and content of your web pages. Users skim your pages by its headings. It is important to use headings to show the document structure. <h1> headings should be used for main headings, followed by <h2> headings, then the less important <h3>, and so on. Note: Use HTML headings for headings only. Don't use headings to make text BIG or bold. HTML Horizontal Rules The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule. The <hr> element is used to separate content (or define a change) in an HTML page: Example <h1>This is heading 1</h1> <p>This is some text.</p> <hr> <h2>This is heading 2</h2> <p>This is some other text.</p> <hr> Try it Yourself
The HTML <head> Element
The HTML <head> element has nothing to do with HTML headings.
The <head> element is a container for metadata. HTML metadata is data about the HTML document. Metadata is not displayed. The <head> element The HTML <pre> Element The HTML <pre> element defines preformatted text. The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks: HTML Background Color The background-color property defines the background color for an HTML element. This example sets the background color for a page to powderblue: Example <body style="background-color:powderblue;"> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> HTML Text Color The color property defines the text color for an HTML element: Example <h1 style="color:blue;">This is a heading</h1> <p style="color:red;">This is a paragraph.</p> Try it Yourself HTML Fonts The font-family property defines the font to be used for an HTML element: Example <h1 style="font-family:verdana;">This is a heading</h1> <p style="font-family:courier;">This is a paragraph.</p> Try it Yourself HTML Text Size The font-size property defines the text size for an HTML element: Example <h1 style="font-size:300%;">This is a heading</h1> <p style="font-size:160%;">This is a paragraph.</p> Try it Yourself HTML Text Alignment The text-align property defines the horizontal text alignment for an HTML element: Example <h1 style="text-align:center;">Centered Heading</h1> <p style="text-align:center;">Centered paragraph.</p> Try it Yourself Tag