HTML Theory
HTML Theory
What is HTML?
HTML stands for Hyper Text Markup Language
HTML is the standard markup language for creating Web pages
HTML describes the structure of a Web page
HTML consists of a series of elements
<h1>Creative</h1>
<p>My first Practicle</p>
</body>
</html>
Example Explained
The <!DOCTYPE html> declaration defines that this document is an
HTML5 document
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.
<tagname>Demo...</tagname>
HTML Documents
All HTML documents must start with a document type declaration: <!DOCTYPE
html>.
The HTML document itself begins with <html> and ends with </html>.
The visible part of the HTML document is between <body> and </body>.
HTML Editors
1.Notepad
2. Sublime
3. Notepad++
4. Atom
5. Vim
Use Lowercase Element Names
HTML allows mixing uppercase and lowercase letters in element names.
Basic HTML
Formatting Tag List
<abbr title="World ">WHO</abbr> Defines an abbreviation or an
was founded in 1948. acronym
<b> Defines bold text
<center> Defines centered text
<del> Defines text that has been deleted
from a document
<em> Defines emphasized text
<font> Defines font, color, and size for text
<i> Defines a part of text in an alternate
voice or mood
<mark> Defines marked/highlighted text
The <br> tag defines a line break, and is an empty element without a closing
tag:
HTML Attributes
All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value"
Images
SHAILESH OSLANIYA : 93770 97697
CREATIVE DESIGN & MULTIMEDIA INSTITUTE
<img src="pic_trulli.jpg" alt="Demo" width="100px" height="100px"
title="demo" border="5px">
Output:
Example
<p>WWF's goal is to: <q>Build a future where people live in harmony
with nature.</q></p>
Example
<p>The <abbr title="Hyper Text Markup Language">HTML</abbr> was founded
in 1948.</p>
Example
<address>
Written by John Doe.<br>
Visit us at:<br>
Example
<p><cite>The Scream</cite> by Edvard Munch. Painted in 1893.</p>
Example:
<bdo dir="rtl">This text will be written from right to left</bdo>
HTML Comments
<!-- Write your comments here -->
When you move the mouse over a link, the mouse arrow will turn into a little
hand.
NOTE
HTML Images
he HTML <img> tag is used to embed an image in a web page.
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.
Definition
1. The accesskey attribute specifies a shortcut key to activate/focus an
element.
Definition
The <ol> tag defines an ordered list. An ordered list can be numerical
or alphabetical.
Attributes
Attributes
HTML Input
<input type="button">
<input type="checkbox">
<input type="color">
<input type="date">
<input type="datetime-local">
<input type="email">
<input type="file">
<input type="hidden">
<input type="image">
<input type="month">
<input type="number">
<input type="password">
<input type="radio">
<input type="range">
<input type="reset">
<input type="search">
<input type="submit">
<input type="tel">
<input type="text">
<input type="time">
<input type="url">
<input type="week">
The multiple attribute works with the following input types: email, and file.
😄 is 128516
😍 is 128525
💗 is 128151
The <canvas> element is only a container for graphics. You must use
JavaScript to actually draw the graphics.
Canvas has several methods for drawing paths, boxes, circles, text, and
adding images.
Example:
What is SVG?
SVG stands for Scalable Vector Graphics
SVG is used to define graphics for the Web
SVG is a W3C recommendation
SVG has several methods for drawing paths, boxes, circles, text, and graphic
images.
Exmaple:
<svg width="100" height="100">
<circle cx="50" cy="50" fill="yellow" r="40" stroke-
width="4" stroke="green" />
</svg>
NOTE: Code explanation: The cx and cy attributes define the x and y coordinates of the
center of the circle. If cx and cy are omitted, the circle's center is set to (0,0) The
r attribute defines the radius of the circle.
SVG Rectangle
<svg width="400" height="100">
<rect width="400" height="100" style="fill:red; stroke-width:10;
stroke:rgb(0,78,255)" />
</svg>
HTML Multimedia
What is Multimedia?
Multimedia comes in many different formats. It can be almost anything you
can hear or see, like images, music, sound, videos, records, films,
animations, and more.
HTML Video
The HTML <video> element is used to show a video on a web page.
Example :
</video>
<article>
<aside>
<details>
<figcaption>
<figure>
<footer>
<header>
<main>
<mark>
<nav>
<section>
<summary>
<time>
logo or icon
authorship information
authorship information
copyright information
contact information
sitemap
back to top links
related documents
Forum post
Blog post
News story
Example:
Bbc news
CSS Syntax
External CSS
Internal CSS
Inline CSS
CSS METHORD
1.TAG
2. CLASS
3. #ID
4. @MEDIA
CSS Backgrounds
background-color: green;
background: rgba(0, 128, 0, 0.3)
background-image: url("gradient_bg.png");
background-repeat: repeat-x;
CSS Margins
The CSS margin properties are used to create space around elements,
outside of any defined borders.
CSS Padding
SHAILESH OSLANIYA : 93770 97697
CREATIVE DESIGN & MULTIMEDIA INSTITUTE
The CSS padding properties are used to generate space around an element's
content, inside of any defined borders.
CSS Outline
An outline is a line that is drawn around elements, OUTSIDE the borders, to
make the element "stand out".
Text Direction
The direction and unicode-bidi properties can be used to change the text
direction of an element:
Example:
p.ex1 {
direction: rtl;
unicode-bidi: bidi-override;
Vertical Alignment
The vertical-align property sets the vertical alignment of an element.
Example:
img.top {
vertical-align: top;
}
Text Decoration
The text-decoration property is used to set or remove decorations from
text.
Example:
text-decoration: none;
text-decoration: overline;
text-decoration: line-through;
text-decoration: underline;
Text Transformation
The text-transform property is used to specify uppercase and lowercase
letters in a text.
Example :
text-transform: uppercase;
text-transform: lowercase;
text-transform: capitalize;