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 TAGHTML Basic Document
<html>
<head>
<title>Document name goes here</title>
</head>
<body>
Visible text goes here
</body>
</html>
Heading Elements <h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<p>This is a paragraph</p>
<p>This is another paragraph</p> HTML links are
defined with the <a> tag. The link address is provided as an attribute: HTML Headings - <h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
Headings are
defined with the <h1> to <h6> tags. Headings Are Important
Use HTML headings for headings only. Don't use headings to
make text BIG or bold.
Search engines use your headings to index the structure and
content of your web pages.
Since users may skim your pages by its headings, it is
important to use headings to show the document structure.
H1 headings should be used as main headings, followed
by H2 headings, then less
<h1>
defines the largest heading. <h6> defines the smallest heading. Attribute Example - HTML links are
defined with the <a> tag. The link address is provided as an attribute:<a href="http://www.w3schools.com">This
is a link</a>HTML Comments
Comments can be inserted in the HTML code to make it more
readable and understandable. Comments are ignored by the browser and are not
displayed.
Comments are written like this: <!-- This is a comment --> |
Paragraphs are defined with the <p> tag. <p>This is a paragraph</p>
<p>This is another paragraph</p> Don't Forget the End Tag
Most browsers will display HTML correctly even if you forget
the end tag: HTML Text Formatting This text is bold
This text is big
This text is italic
This is computer output
This is subscript and superscript HTML Formatting Tags
HTML uses tags
like <b> and <i> for formatting output, like bold or italic text.
These HTML
tags are called formatting tags.
The HTML Style Attribute
The purpose of the style attribute is:
To provide a common way to style all HTML elements.
Styles was introduced with HTML 4, as the new and preferred
way to style HTML elements. With HTML styles, styles can be added to HTML
elements directly by using the style attribute, or indirectly by in separate
style sheets (CSS files).
The Image Tag and the Src Attribute
In HTML, images are defined with the <img> tag.
The <img> tag is empty, which means that it
contains attributes only and it has no closing tag.
To display an image on a page, you need to use the src
attribute. Src stands for "source". The value of the src attribute is
the URL of the image you want to display on your page. <img src="url" /> The Alt Attribute
The alt attribute is used to define an "alternate
text" for an image. The value of the alt attribute is an author-defined
text: | Tables and the Border Attribute
If you do not specify a border attribute the table will be
displayed without any borders. Sometimes this can be useful, but most of the
time, you want the borders to show.
To display a table with borders, you will have to use the
border attribute: <table border="1">
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>Headings in a Table - Headings in a table are defined with the <th> tag. <table border="1">
<tr>
<th>Heading</th>
<th>Another Heading</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</tdColor Values
HTML colors are defined using a hexadecimal (hex) notation
for the combination of Red, Green, and Blue color values (RGB).
The lowest value that can be given to one of the light
sources is 0 (hex 00). The highest value is 255 (hex FF).
Hex values are written as 3 double digit numbers, starting
with a # sign. Color Color HEX Color Black - #000000 rgb(0,0,0) Red - #FF0000 rgb(255,0,0) Green - #00FF00 rgb(0,255,0) Blue - #0000FF rgb(0,0,255) |