Html5: !doctype HTML Head Title /title /head Body h1 /h1 P /P /body /HTML
Html5: !doctype HTML Head Title /title /head Body h1 /h1 P /P /body /HTML
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
The HTML document itself begins with <html> and ends with </html>.
The visible part of the HTML document is between <body> and </body>.
The <html> element is the root element of an HTML page
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in
the browser's title bar or in the page's tab)
The <body> element defines the document's body, and is a container for all
the visible contents, such as headings, paragraphs, images, hyperlinks,
tables, lists, etc.
<h1> defines the most important heading. <h6> defines the least important
heading
The source file (src), alternative text (alt), width, and height are provided as
attributes
The <br> tag defines a line break, and is an empty element without a
closing tag
The style attribute is used to add styles to an element, such as color, font,
size, and more
You should always include the lang attribute inside the <html> tag, to
declare the language of the Web page. This is meant to assist search engines
and browsers.
<!DOCTYPE html>
<html lang="en">
<body>
...
</body>
</html>
Country codes can also be added to the language code in the lang attribute.
So, the first two characters define the language of the HTML page, and the
last two characters define the country.
<!DOCTYPE html>
<html lang="en-US">
<body>
...
</body>
</html>
The value of the title attribute will be displayed as a tooltip when you
mouse over the element
The HTML standard does not require quotes around attribute values.
The href attribute of <a> specifies the URL of the page the link goes to
The src attribute of <img> specifies the path to the image to be displayed
The width and height attributes of <img> provide size information for
images
The style attribute is used to add styles to an element, such as color, font,
size, and more
The lang attribute of the <html> tag declares the language of the Web page
Each HTML heading has a default size. However, you can specify the size
for any heading with the style attribute, using the CSS font-size property
The <hr> tag defines a thematic break in an HTML page, and is most often
displayed as a horizontal rule(Line).
Use <br> if you want a line break (a new line) without starting a new
paragraph
The HTML style attribute is used to add styles to an element, such as color,
font, size, and more.
<tagname style="property:value;">
<body style="background-color:powderblue;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
The CSS color property defines the text color for an HTML element
The CSS font-family property defines the font to be used for an HTML
element
The CSS font-size property defines the text size for an HTML element
You can add comments to your HTML source by using the following syntax
Colors Defining
<h1 style="background-color:#ff6347;">...</h1>
<!DOCTYPE html>
<html>
<head>
<style>
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
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.
Clicking on the link text, will send the reader to the specified URL address
To use an image as a link, just put the <img> tag inside the <a> tag
<a href="default.asp">
</a>
Use mailto: inside the href attribute to create a link that opens the user's
email program (to let them send a new email)
Images are not technically inserted into a web page; images are linked to
web pages. The <img> tag creates a holding space for the referenced image.
The <img> tag is empty, it contains attributes only, and does not have a
closing tag.
You can use the style attribute to specify the width and height of an image.
Or
Image Floating
Use the CSS float property to let the image float to the right or to the left of
a text:
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
HTML lists allow web developers to group a set of related items in lists
An unordered list starts with the <ul> tag. Each list item starts with the
<li> tag.
The list items will be marked with bullets (small black circles) by default
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
An ordered list starts with the <ol> tag. Each list item starts with the <li>
tag.
<ol start="50">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
The HTML class attribute is used to specify a class for an HTML element.
The class attribute is often used to point to a class name in a style sheet. It
can also be used by a JavaScript to access and manipulate elements with
the specific class name.
● The HTML class attribute specifies one or more class names for an
element
● Classes are used by CSS and JavaScript to select and access specific
elements
● The class attribute can be used on any HTML element
● The class name is case sensitive
● Different HTML elements can point to the same class name
● JavaScript can access elements with a specific class name with the
getElementsByClassName() method
The syntax for id is: write a hash character (#), followed by an id name.
Then, define the CSS properties within curly braces {}.
To use a bookmark, you must first create it, and then add a link to it.
Then, when the link is clicked, the page will scroll to the location with the
bookmark
Type Description
</form>
The <label> element also help users who have difficulty clicking on
very small regions (such as radio buttons or checkboxes) - because
when the user clicks the text within the <label> element, it toggles
the radio button/checkbox.
<form>
<label for="html">HTML</label><br>
<label for="css">CSS</label><br>
<label for="javascript">JavaScript</label>
</form>