You are on page 1of 5

<a href="https://www.w3schools.

com">This is a link</a>
<img src="url" alt="some_text" style="width:width;height:height;">
The alt attribute specifies an alternative text to be used, when an image cannot be displayed.
<br> is an empty element without a closing tag (the <br> tag defines a line break).
Empty elements can be "closed" in the opening tag like this: <br />.
HTML tags are not case sensitive: <P> means the same as <p>.
lowercase is recommended.
<html lang="en-US">
<p title="I'm a tooltip"> . The value of the title attribute will be displayed as a tooltip when you
mouse over the paragraph:
HTML links are defined with the <a> tag.
<p title=About W3Schools>
doesn't correctly displays about w3schools
use double quotes
The <hr> tag (horizontal rule) defines a thematic break in an HTML page (e.g. a shift of topic).
In HTML, the <hr> tag has no end tag.
In XHTML, the <hr> tag must be properly closed, like this: <hr />.
The HTML <pre> element defines preformatted text.
<pre>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.


</pre>

The HTML Style Attribute


<tagname style="property:value;">
<body style="background-color:powderblue;">
<h1 style="color:blue;">This is a heading</h1>
<h1 style="font-family:verdana;">This is a heading</h1>
<h1 style="font-size:300%;">This is a heading</h1>
<h1 style="text-align:center;">Centered Heading</h1>
<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
<mark> - Marked text (highlighted)
<small> - Small text
<del> - Deleted text (cross lined)
<ins> - Inserted text
<sub> - Subscript text
<sup> - Superscript text

The HTML <q> element defines a short quotation.

The HTML <blockquote> element defines a section that is quoted from another source.

<blockquote cite="http://www.worldwildlife.org/who/index.html">
For 50 years, WWF has been protecting the future of nature.
The world's leading conservation organization,
WWF works in 100 countries and is supported by
1.2 million members in the United States and
close to 5 million globally.
</blockquote>
<abbr title="World Health Organization">WHO</abbr>
The HTML <address> element defines contact information (author/owner) of a document or an
article.

<address>
Written by John Doe.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address>

The HTML <cite> element defines the title of a work.

<p><cite>The Scream</cite> by Edvard Munch. Painted in 1893.</p>

The HTML <bdo> element defines bi-directional override.

<bdo dir="rtl">This text will be written from right to left</bdo>

<!--[if IE 9]>
.... some HTML here ....
<![endif]-->
executed by internet explorer only.

color names:
tomato, orange, dodgerBlure, gray, slateBlue, violet, lightGray,
<h1 style="border:2px solid Tomato">Hello World</h1>
<h1 style="background-color:rgb(255, 99, 71)">...</h1>
<h1 style="background-color:rgba(255, 99, 71, 0.5)">..
<h1 style="background-color:hsl(9, 100%, 64%)">.
<h1 style="background-color:hsla(9, 100%, 64%, 0.5)">
The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all):
CSS stands for Cascading Style Sheets.

CSS describes how HTML elements are to be displayed on screen, paper, or in other media.
Added to html in 3 ways:
1. inline eg. <h1 style="color:blue;">This is a Blue Heading</h1>
2. internal eg. <head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
3. external eg. <head>
<link rel="stylesheet" href="styles.css">
</head>

#rrggbb -> hex value.

<a href="html_images.asp">HTML Images</a>


local links

<a href="https://www.w3schools.com/" target="_blank">Visit W3Schools!</a>


open website in a new window/tab
images as link
<a href="default.asp">
<img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0;">
</a>

<h2 id="C4">Chapter 4</h2>


create bookmark
and then add
<a href="#C4">Jump to Chapter 4</a>

<p><img src="smiley.gif" alt="Smiley face" style="float:right;width:42px;height:42px;">


The image will float to the right of the text.</p>

<img src="planets.gif" alt="Planets" usemap="#planetmap" style="width:145px;height:126px;">

has clickable areas

<body style="background-image:url('skies.jpg')">
Each table row is defined with the <tr> tag. A table header is defined with the <th> tag. By default,
table headings are bold and centered. A table data/cell is defined with the <td> tag.

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>

table, th, td {
border: 1px solid black;
}

th, td {
padding: 15px;
}
th {
text-align: left;
}

<table style="width:100%">
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>
</tr>
<tr>

similarly for rows

<table style="width:100%">
<caption>Monthly savings</caption>

special style for one table


<table id="t01">
<tr>
<th>First
now define its attributes
table#t01 {
width: 100%;
background-color: #f1f1c1;
}

table#t01 tr:nth-child(even) {
background-color: #eee;
}
table#t01 tr:nth-child(odd) {
background-color: #fff;
}
table#t01 th {
color: white;
background-color: black;
}

<ul style="list-style-type:disc">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
style type can be disc, circle, square, none.
<ol type="1">
type can be 1, A, a, I, i
The <dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag
describes each term:

Example
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>

output

A Description List (in bold)

Coffee
- black hot drink
Milk
- white cold drink

Block-level Elements

<div>
<h1> - <h6>
<p>
<form>

Inline elements
<span>
<a>
<img>

<head>
<meta charset="UTF-8">
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
<meta name="author" content="John Doe">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

You might also like