Skip to content

HTML Note1 Basic Structure

snowicecat edited this page Feb 27, 2015 · 1 revision

Basic Structure of an HTML WebPage

Tag

<Doctype>

Tell the Doctype of a webpage. Chrome, Fire or just a Simple HTML.

e.g <!doctype html>

<HTML>

Tell the compiler that the program start and end here.

e.g <html> ; </html>

<Title>

Shows the tag name of the webpage.

e.g <title> {--} </title>

<meta>

Metadata is data (information) about data.

The tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable.

Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata.

The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services.

e.g

<meta charset="UTF-8">
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
<meta name="author" content="Hege Refsnes">

###<style> The <style> tag is used to define style information for an HTML document.

Inside the <style> element you specify how HTML elements should render in a browser.

Each HTML document can contain multiple <style> tags.

###<body> The <body> tag is the main tag of a website page.

###<div> The <div> tag defines a division or a section in an HTML document.

The <div> tag is used to group block-elements to format them with CSS.

###<h1>, <h2>, <h3> The different Headings styles. Bold and Large Contents. Only have 1~6 different heading size.

###<p> This means we start to write a paragraph. HTML ignores all spaces and line feeds in codes. So <p> is used to format the different lines. But between 2 paragraph, there is an empty line.

How to eliminate that line? The good way is to use <br /> to enter to a new line directly.

e.g <p>--text you want<br />to write--</p>

###<hr /> Create a line to separate paragraphs.

###<a href="link"> The <a> means here is a link.

e.g <a href="www.baidu.com">Visit Baidu!</a>

###Index.html Index.html is a special file name, which represents the home/main page of a website.

Clone this wiki locally