Web Tutorial 2

Payza Signup
 

HTML5 Application Cache | What is Application Cache? | HTML5 Cache Manifest Example | Cache Manifest Basics | The Manifest File | Updating the Cache



HTML5 Application Cache

With HTML5 it is easy to make an offline version of a web application, by creating a cache manifest file.

What is Application Cache?

HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection.
Application cache gives an application three advantages:

  1. Offline browsing - users can use the application when they're offline 
  2. Speed - cached resources load faster 
  3. Reduced server load - the browser will only download updated/changed resources from the server

Browser Support

Application cache is supported in all major browsers, except Internet Explorer.

HTML5 Cache Manifest Example

The example below shows an HTML document with a cache manifest (for offline browsing):
 <html manifest="demo.appcache">

<body>
The content of the document......
</body>

</html>

Cache Manifest Basics

To enable application cache, include the manifest attribute in the document's <html>  tag:

<html manifest="demo.appcache">
...
</html>

Every page with the manifest attribute specified will be cached when the user visits it. If the manifest attribute is not specified, the page will not be cached (unless the page is specified directly in the manifest file).
The recommended file extension for manifest files is: ".appcache" A manifest file needs to be served with the correct MIME-type, which is "text/cache-manifest". Must be configured on the web server.

The Manifest File

The manifest file is a simple text file, which tells the browser what to cache (and what to never cache). The manifest file has three sections:
  • CACHE MANIFEST - Files listed under this header will be cached after they are downloaded for the first time
  • NETWORK - Files listed under this header require a connection to the server, and will never be cached
  • FALLBACK - Files listed under this header specifies fallback pages if a page is inaccessible

CACHE MANIFEST The first line, CACHE MANIFEST, is required:
CACHE MANIFEST
/theme.css
/logo.gif
/main.js

The manifest file above lists three resources: a CSS file, a GIF image, and a JavaScript file. When the manifest file is loaded, the browser will download the three files from the root directory of the web site. Then, whenever the user is not connected to the internet, the resources will still be available.
NETWORK The NETWORK section below specifies that the file "login.asp" should never be cached, and will not be available offline:
NETWORK:
login.asp 

An asterisk can be used to indicate that all other resources/files require an internet connection:
NETWORK:
*
FALLBACK
The FALLBACK section below specifies that "offline.html" will be served in place of all files in the /html/ catalog, in case an internet connection cannot be established:
FALLBACK:
/html/ /offline.html
Note: The first URI is the resource, the second is the fallback.

Updating the Cache

Once an application is cached, it remains cached until one of the following happens:
  • The user clears the browser's cache
  • The manifest file is modified (see tip below)
  • The application cache is programmatically updated
  • Example - Complete Cache Manifest File
CACHE MANIFEST
# 2012-02-21 v1.0.0
/theme.css
/logo.gif
/main.js

NETWORK:
login.asp

FALLBACK:
/html/ /offline.html
Tip: Lines starting with a "#" are comment lines, but can also serve another purpose. An application's cache is only updated when its manifest file changes. If you edit an image or change a JavaScript function, those changes will not be re-cached. Updating the date and version in a comment line is one way to make the browser re-cache your files.

Notes on Application Cache

Be careful with what you cache.
Once a file is cached, the browser will continue to show the cached version, even if you change the file on the server. To ensure the browser updates the cache, you need to change the manifest file.
Note: Browsers may have different size limits for cached data (some browsers have a 5MB limit per site).

[Read More...]


HTML5 Inline SVG - What is SVG? - SVG Advantag - Browser Supportes - Embed SVG Directly Into HTML Pages - Example - SVG Elements




What is SVG?


  • SVG stands for Scalable Vector Graphics
  • SVG is used to define vector-based graphics for the Web
  • SVG defines the graphics in XML format
  • SVG graphics do NOT lose any quality if they are zoomed or resized
  • Every element and every attribute in SVG files can be animated
  • SVG is a W3C recommendation

SVG Advantages

Advantages of using SVG over other image formats (like JPEG and GIF) are:
  • SVG images can be created and edited with any text editor
  • SVG images can be searched, indexed, scripted, and compressed
  • SVG images are scalable
  • SVG images can be printed with high quality at any resolution
  • SVG images are zoomable (and the image can be zoomed without degradation)

Browser Support

Internet Explorer 9, Firefox, Opera, Chrome, and Safari support inline SVG.

Embed SVG Directly Into HTML Pages

In HTML5, you can embed SVG elements directly into your HTML page:

Example:

<!DOCTYPE html>
<html>
<body>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190">
  <polygon points="100,10 40,180 190,60 10,60 160,180"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg>

</body>
</html>


Result:



SVG Reference:

SVG Elements


ElementDescriptionAttributes
<a>Creates a link around SVG elementsxlink:show
xlink:actuate
xlink:href
target
<altGlyph>Provides control over the glyphs used to render particular character datax
y
dx
dy
rotate
glyphRef
format
xlink:href
<altGlyphDef>Defines a substitution set for glyphsid
<altGlyphItem>Defines a candidate set of glyph substitutionsid
<animate>Defines how an attribute of an element changes over timeattributeName="the name of the target attribute"
from="the starting value"
to="the ending value"
dur="the duration"
repeatCount="the number of time the animation will take place"
<animateColor>Defines a color transformation over timeby="a relative offset value"
from="the starting value"
to="the ending value"
<animateMotion>Causes a referenced element to move along a motion pathcalcMode="the interpolation mode for the animation. Can be 'discrete', 'linear', 'paced', 'spline'"
path="the motion path"
keyPoints="how far along the motion path the object shall move at the moment in time"
rotate="applies a rotation transformation"
xlink:href="an URI reference to the <path> element which defines the motion path"
<animateTransform>Animates a transformation attribute on a target element, thereby allowing animations to control translation, scaling, rotation and/or skewingby="a relative offset value"
from="the starting value"
to="the ending value"
type="the type of transformation which is to have its values change over time. Can be 'translate', 'scale', 'rotate', 'skewX', 'skewY'"
<circle>Defines a circlecx="the x-axis center of the circle"
cy="the y-axis center of the circle"
r="The circle's radius". Required.

+ presentation attributes:
Color, FillStroke, Graphics
<clipPath>Clipping is about hiding what normally would be drawn. The stencil which defines what is and what isn't drawn is called a clipping pathclip-path="the referenced clipping path is intersected with the referencing clipping path"
clipPathUnits="'userSpaceOnUse' or 'objectBoundingBox'. The second value makes units of children a fraction of the object bounding box which uses the mask (default: 'userSpaceOnUse')"
<color-profile>Specifies a color profile description (when the document is styled using CSS)local="the unique ID for a locally stored color profile"
name=""
rendering-intent="auto|perceptual|relative-colorimetric|saturation|absolute-colorimetric"
xlink:href="the URI of an ICC profile resource"
<cursor>Defines a platform-independent custom cursorx="the x-axis top-left corner of the cursor (default is 0)"
y="the y-axis top-left corner of the cursor (default is 0)"
xlink:href="the URI of the image to use as the cursor
<defs>A container for referenced elements
<desc>A text-only description for container elements or graphic elements in SVG (user agents may display the text as a tooltip)
<ellipse>Defines an ellipsecx="the x-axis center of the ellipse"
cy="the y-axis center of the ellipse"
rx="the length of the ellipse's radius along the x-axis". Required.
ry="the length of the ellipse's radius along the y-axis". Required.

+ presentation attributes:
Color, FillStroke, Graphics
<feBlend>Composes two objects together according to a certain blending modemode="the image blending modes: normal|multiply|screen|darken|lighten"
in="identifies input for the given filter primitive: SourceGraphic | SourceAlpha | BackgroundImage | BackgroundAlpha | FillPaint | StrokePaint | <filter-primitive-reference>"
in2="the second input image to the blending operation"
feColorMatrixSVG filter. Applies a matrix transformation
feComponentTransferSVG filter. Performs component-wise remapping of data
feCompositeSVG filter.
feConvolveMatrixSVG filter.
feDiffuseLightingSVG filter.
feDisplacementMapSVG filter.
feDistantLightSVG filter. Defines a light source
feFloodSVG filter.
feFuncASVG filter. Sub-element to feComponentTransfer
feFuncBSVG filter. Sub-element to feComponentTransfer
feFuncGSVG filter. Sub-element to feComponentTransfer
feFuncRSVG filter. Sub-element to feComponentTransfer
feGaussianBlurSVG filter. Performs a Gaussian blur on the image
feImageSVG filter.
feMergeSVG filter. Creates image layers on top of each other
feMergeNodeSVG filter. Sub-element to feMerge
feMorphologySVG filter. Performs a "fattening" or "thinning" on a source graphic
feOffsetSVG filter. Moves an image relative to its current position
fePointLightSVG filter.
feSpecularLightingSVG filter.
feSpotLightSVG filter.
feTileSVG filter.
feTurbulenceSVG filter.
filterContainer for filter effects
fontDefines a font
font-faceDescribes the characteristics of a font
font-face-format
font-face-name
font-face-src
font-face-uri
foreignObject
<g>Used to group together elementsid="the name of the group"
fill="the fill color for the group"
opacity="the opacity for the group"

+ presentation attributes:
All
glyphDefines the graphics for a given glyph
glyphRefDefines a possible glyph to use
hkern
<image>Defines an imagex="the x-axis top-left corner of the image"
y="the y-axis top-left corner of the image"
width="the width of the image". Required.
height="the height of the image". Required.
xlink:href="the path to the image". Required.

+ presentation attributes:
Color, Graphics, Images, Viewports
<line>Defines a linex1="the x start point of the line"
y1="the y start point of the line"
x2="the x end point of the line"
y2="the y end point of the line"

+ presentation attributes:
Color, FillStroke, Graphics, Markers
<linearGradient>Defines a linear gradient. Linear gradients fill the object by using a vector, and can be defined as horizontal, vertical or angular gradients.id="the unique id used to reference this pattern. Required to reference it"
gradientUnits="'userSpaceOnUse' or 'objectBoundingBox'. Use the view box or object to determine relative position of vector points. (Default 'objectBoundingBox')"
gradientTransform="the transformation to apply to the gradient"
x1="the x start point of the gradient vector (number or % - 0% is default)"
y1="the y start point of the gradient vector. (0% default)"
x2="the x end point of the gradient vector. (100% default)"
y2="the y end point of the gradient vector. (0% default)"
spreadMethod="'pad' or 'reflect' or 'repeat'"
xlink:href="reference to another gradient whose attribute values are used as defaults and stops included. Recursive"
<marker>Markers can be placed on the vertices of lines, polylines, polygons and paths. These elements can use the marker attributes "marker-start", "marker-mid" and "marker-end"' which inherit by default or can be set to 'none' or the URI of a defined marker. You must first define the marker before you can reference it via its URI. Any kind of shape can be put inside marker. They are drawn on top of the element they are attached tomarkerUnits="'strokeWidth' or 'userSpaceOnUse'. If 'strokeWidth' is used then one unit equals one stroke width. Otherwise, the marker does not scale and uses the the same view units as the referencing element (default 'strokeWidth')"
refx="the position where the marker connects with the vertex (default 0)"
refy="the position where the marker connects with the vertex (default 0)"
orient="'auto' or an angle to always show the marker at. 'auto' will compute an angle that makes the x-axis a tangent of the vertex (default 0)"
markerWidth="the width of the marker (default 3)"
markerHeight="the height of the marker (default 3)"
viewBox="the points "seen" in this SVG drawing area. 4 values separated by white space or commas. (min x, min y, width, height)"

+ presentation attributes:
All
<mask>Masking is a combination of opacity values and clipping. Like clipping you can use shapes, text or paths to define sections of the mask. The default state of a mask is fully transparent which is the opposite of clipping plane. The graphics in a mask sets how opaque portions of the mask aremaskUnits="'userSpaceOnUse' or 'objectBoundingBox'. Set whether the clipping plane is relative the full view port or object (default: 'objectBoundingBox')"
maskContentUnits="Use the second with percentages to make mask graphic positions relative the object. 'userSpaceOnUse' or 'objectBoundingBox' (default: 'userSpaceOnUse')"
x="the clipping plane of the mask (default: -10%)"
y="the clipping plane of the mask (default: -10%)"
width="the clipping plane of the mask (default: 120%)"
height="the clipping plane of the mask (default: 120%)"
metadataSpecifies metadata
missing-glyph
mpath
<path>Defines a pathd="a set of commands which define the path"
pathLength="If present, the path will be scaled so that the computed path length of the points equals this value"
transform="a list of transformations"

+ presentation attributes:
Color, FillStroke, Graphics, Markers
<pattern>Defines the coordinates you want the view to show and the size of the view. Then you add shapes into your pattern. The pattern repeats when an edge of the view box (viewing area) is hitid="the unique id used to reference this pattern." Required.
patternUnits="'userSpaceOnUse' or 'objectBoundingBox'. The second value makes units of x, y, width, height a fraction (or %) of the object bounding box which uses the pattern."
patternContentUnits="'userSpaceOnUse' or 'objectBoundingBox'"
patternTransform="allows the whole pattern to be transformed"
x="pattern's offset from the top-left corner (default 0)"
y="pattern's offset from the top-left corner. (default 0)"
width="the width of the pattern tile (default 100%)"
height="the height of the pattern tile (default 100%)"
viewBox="the points "seen" in this SVG drawing area. 4 values separated by white space or commas. (min x, min y, width, height)"
xlink:href="reference to another pattern whose attribute values are used as defaults and any children are inherited. Recursive"
<polygon>Defines a graphic that contains at least three sidespoints="the points of the polygon. The total number of points must be even". Required.
fill-rule="part of the FillStroke presentation attributes"

+ presentation attributes:
Color, FillStroke, Graphics, Markers
<polyline>Defines any shape that consists of only straight linespoints="the points on the polyline". Required.

+ presentation attributes:
Color, FillStroke, Graphics, Markers
<radialGradient>Defines a radial gradient. Radial gradients are created by taking a circle and smoothly changing values between gradient stops from the focus point to the outside radius.gradientUnits="'userSpaceOnUse' or 'objectBoundingBox'. Use the view box or object to determine relative position of vector points. (Default 'objectBoundingBox')"
gradientTransform="the transformation to apply to the gradient"
cx="the center point of the gradient (number or % - 50% is default)"
cy="the center point of the gradient. (50% default)"
r="the radius of the gradient. (50% default)"
fx="the focus point of the gradient. (0% default)"
fy="The focus point of the gradient. (0% default)"
spreadMethod="'pad' or 'reflect' or 'repeat'"
xlink:href="Reference to another gradient whose attribute values are used as defaults and stops included. Recursive"
<rect>Defines a rectanglex="the x-axis top-left corner of the rectangle"
y="the y-axis top-left corner of the rectangle"
rx="the x-axis radius (to round the element)"
ry="the y-axis radius (to round the element)"
width="the width of the rectangle". Required.
height="the height of the rectangle" Required.

+ presentation attributes:
Color, FillStroke, Graphics
scriptContainer for scripts (e.g., ECMAScript)
setSets the value of an attribute for a specified duration
<stop>The stops for a gradientoffset="the offset for this stop (0 to 1/0% to 100%)". Required.
stop-color="the color of this stop"
stop-opacity="the opacity of this stop (0 to 1)"
styleAllows style sheets to be embedded directly within SVG content
<svg>Creates an SVG document fragmentx="top left corner when embedded (default 0)"
y="top left corner when embedded (default 0)"
width="the width of the svg fragment (default 100%)"
height="the height of the svg fragment (default 100%)"
viewBox="the points "seen" in this SVG drawing area. 4 values separated by white space or commas. (min x, min y, width, height)"
preserveAspectRatio="'none' or any of the 9 combinations of 'xVALYVAL' where VAL is 'min', 'mid' or 'max'. (default xMidYMid)"
zoomAndPan="'magnify' or 'disable'. Magnify option allows users to pan and zoom your file (default magnify)"
xml="outermost <svg> element needs to setup SVG and its namespace: xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve""

+ presentation attributes:
All
switch
symbol
<text>Defines a textx="a list of x-axis positions. The nth x-axis position is given to the nth character in the text. If there are additional characters after the positions run out they are placed after the last character. 0 is default"
y="a list of y-axis positions. (see x). 0 is default"
dx="a list of lengths which moves the characters relative to the absolute position of the last glyph drawn. (see x)"
dy="a list of lengths which moves the characters relative to the absolute position of the last glyph drawn. (see x)"
rotate="a list of rotations. The nth rotation is performed on the nth character. Additional characters are NOT given the last rotation value"
textLength="a target length for the text that the SVG viewer will attempt to display the text between by adjusting the spacing and/or the glyphs. (default: The text's normal length)"
lengthAdjust="tells the viewer what to adjust to try to accomplish rendering the text if the length is specified. The two values are 'spacing' and 'spacingAndGlyphs'"

+ presentation attributes:
Color, FillStroke, Graphics, FontSpecification, TextContentElements
textPath
titleA text-only description for elements in SVG - not displayed as part of the graphics. User agents may display the text as a tooltip
<tref>References any <text> element in the SVG document and reuse itIdentical to the <text> element
<tspan>Identical to the <text> element but can be nested inside text tags and inside itselfIdentical to the <text> element
+ in addition:
xlink:href="Reference to a <text> element"
<use>Uses a URI to reference a <g>, <svg> or other graphical element with a unique id attribute and replicate it. The copy is only a reference to the original so only the original exists in the document. Any change to the original effects all copies.x="the x-axis top-left corner of the cloned element"
y="the y-axis top-left corner of the cloned element"
width="the width of the cloned element"
height="the height of the cloned element"
xlink:href="a URI reference to the cloned element"

+ presentation attributes:
All
view
vkern

[Read More...]


HTML5 - New Elements



New Elements in HTML5

The internet has changed a lot since HTML 4.01 became a standard in 1999.
Today, some elements in HTML 4.01 are obsolete, never used, or not used the way they were intended to. These elements are removed or re-written in HTML5.
To better handle today's internet use, HTML5 includes new elements for better structure, better form handling, drawing, and for media content.

New Semantic/Structural Elements

HTML5 offers new elements for better structure:
TagDescription
<article>Defines an article
<aside>Defines content aside from the page content
<bdi>Isolates a part of text that might be formatted in a different direction from other text outside it
<command>Defines a command button that a user can invoke
<details>Defines additional details that the user can view or hide
<summary>Defines a visible heading for a <details> element
<figure>Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
<figcaption>Defines a caption for a <figure> element
<footer>Defines a footer for a document or section
<header>Defines a header for a document or section
<hgroup>Groups a set of <h1> to <h6> elements when a heading has multiple levels
<mark>Defines marked/highlighted text
<meter>Defines a scalar measurement within a known range (a gauge)
<nav>Defines navigation links
<progress>Represents the progress of a task
<ruby>Defines a ruby annotation (for East Asian typography)
<rt>Defines an explanation/pronunciation of characters (for East Asian typography)
<rp>Defines what to show in browsers that do not support ruby annotations
<section>Defines a section in a document
<time>Defines a date/time
<wbr>Defines a possible line-break

New Media Elements

HTML5 offers new elements for media content:
TagDescription
<audio>Defines sound content
<video>Defines a video or movie
<source>Defines multiple media resources for <video> and <audio>
<embed>Defines a container for an external application or interactive content (a plug-in)
<track>Defines text tracks for <video> and <audio>

The new <canvas> Element </canvas>

TagDescription
<canvas>Used to draw graphics, on the fly, via scripting (usually JavaScript)

New Form Elements


HTML5 offers new form elements, for more functionality:
TagDescription
<datalist>Specifies a list of pre-defined options for input controls
<keygen>Defines a key-pair generator field (for forms)
<output>Defines the result of a calculation



Removed Elements

The following HTML 4.01 elements are removed from HTML5:
  • <acronym>
  • <applet>
  • <basefont>
  • <big>
  • <center>
  • <dir>
  • <font>
  • <frame>
  • <frameset>
  • <noframes>
  • <strike>
  • <tt>
[Read More...]


HTML Tutorial Part-5: HTML Paragraph and HTML Text Formatting



Paragraphs are defined with the <p> tag.
Example:
<p>This is a paragraph</p>
<p>This is another paragraph</p>
Note: Browsers automatically add an empty line before and after a paragraph.

Don't Forget the End Tag
Most browsers will display HTML correctly even if you forget the end tag:
Example:
<p>This is a paragraph
<p>This is another paragraph
The example above will work in most browsers, but don't rely on it. Forgetting the end tag can produce unexpected results or errors.
Note: Future version of HTML will not allow you to skip end tags.

HTML Line Breaks:

Use the <br /> tag if you want a line break (a new line) without starting a new paragraph:
Example
<p>This is<br />a para<br />graph with line breaks</p>

he <br /> element is an empty HTML element. It has no end tag.
<br> or <br />

In XHTML, XML, elements with no end tag (closing tag) are not allowed.

Even if <br> works in all browsers, writing <br /> instead works better in XHTML and XML applications.

HTML Output - Useful Tips
You cannot be sure how HTML will be displayed. Large or small screens, and resized windows will create different results.

With HTML, you cannot change the output by adding extra spaces or extra lines in your HTML code.

The browser will remove extra spaces and extra lines when the page is displayed. Any number of lines count as one line, and any number of spaces count as one space.

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 (look at the bottom of this page for a complete reference).
Remark     Often <strong> renders as <b>, and <em> renders as <i>.

However, there is a difference in the meaning of these tags:

<b> or <i> defines bold or italic text only.

<strong> or <em> means that you want the text to be rendered in a way that the user understands as "important". Today, all major browsers render strong as bold and em as italics. However, if a browser one day wants to make a text highlighted with the strong feature, it might be cursive for example and not bold!

HTML Text Formatting Tags

Tag Description
<b> Defines bold text
<big> Defines big text
<em> Defines emphasized text 
<i> Defines italic text
<small> Defines small text
<strong> Defines strong text
<sub> Defines subscripted text
<sup> Defines superscripted text
<ins> Defines inserted text
<del> Defines deleted text

HTML "Computer Output" Tags

Tag Description
<code> Defines computer code text
<kbd> Defines keyboard text 
<samp> Defines sample computer code
<tt> Defines teletype text
<var> Defines a variable
<pre> Defines preformatted text

HTML Citations, Quotations, and Definition Tags

Tag Description
<abbr> Defines an abbreviation
<acronym> Defines an acronym
<address> Defines contact information for the author/owner of a document
<bdo> Defines the text direction
<blockquote> Defines a long quotation
<q> Defines a short quotation
<cite> Defines a citation
<dfn> Defines a definition term

[Read More...]


HTML Tutorial Part-4



HTML Headings

Headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important heading.
<h1>HTML Headings H1</h1>
<h2>HTML Headings H2</h2>
<h3>HTML Headings H3</h3>
Note: Browsers automatically add some empty space (a margin) before and after each heading.

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 the less important H3 headings, and so on.

HTML Lines

The <hr /> tag creates a horizontal line in an HTML page.
The hr element can be used to separate content:

<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>

HTML Comments

Comments can be inserted into 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 -->

HTML Tip - How to View HTML Source

Have you ever seen a Web page and wondered "Hey! How did they do that?"
To find out, right-click in the page and select "View Source" (IE) or "View Page Source" (Firefox), or similar for other browsers. This will open a window containing the HTML code of the page.
[Read More...]


HTML Attributes Reference:



A complete list of legal attributes for each HTML element is listed in our:
DTD: indicates in which HTML 4.01 / XHTML 1.0 DTD the tag is allowed. S=Strict, T=Transitional, and F=Frameset

Tag Description DTD
<!--...--> Defines a comment STF
<!DOCTYPE>  Defines the document type STF
<a> Defines an anchor STF
<abbr> Defines an abbreviation STF
<acronym> Defines an acronym STF
<address> Defines contact information for the author/owner of a document STF
<applet> Deprecated. Defines an embedded applet TF
<area /> Defines an area inside an image-map STF
<b> Defines bold text STF
<base /> Specifies the base URL/target for all relative URLs in a document STF
<basefont /> Deprecated. Specifies a default color, size, or font for all the text in a document TF
<bdo> Overrides the current text direction STF
<big> Defines big text STF
<blockquote> Defines a long quotation STF
<body> Defines the document's body STF
<br /> Defines a single line break STF
<button> Defines a clickable button STF
<caption> Defines a table caption STF
<center> Deprecated. Defines centered text TF
<cite> Defines a citation STF
<code> Defines a piece of computer code STF
<col /> Defines attribute values for one or more columns in a table  STF
<colgroup> Specifies a group of one or more columns in a table for formatting STF
<dd> Defines a description of an item in a definition list STF
<del> Defines text that has been deleted from a document STF
<dfn> Defines a definition term STF
<dir> Deprecated. Defines a directory list TF
<div> Defines a section in a document STF
<dl> Defines a definition list STF
<dt> Defines a term (an item) in a definition list STF
<em> Defines emphasized text  STF
<fieldset> Groups related elements in a form STF
<font> Deprecated. Defines font, color, and size for text TF
<form> Defines an HTML form for user input STF
<frame /> Defines a window (a frame) in a frameset F
<frameset> Defines a set of frames F
<h1> to <h6> Defines HTML headings STF
<head> Defines information about the document STF
<hr /> Defines a horizontal line STF
<html> Defines the root of an HTML document STF
<i> Defines italic text STF
<iframe> Defines an inline frame TF
<img /> Defines an image STF
<input /> Defines an input control STF
<ins> Defines text that has been inserted into a document STF
<kbd> Defines keyboard input STF
<label> Defines a label for an <input> element STF
<legend> Defines a caption for a <fieldset> element STF
<li> Defines a list item STF
<link /> Defines the relationship between a document and an external resource STF
<map> Defines a client-side image-map  STF
<menu> Deprecated. Defines a menu list TF
<meta /> Defines metadata about an HTML document STF
<noframes> Defines an alternate content for users that do not support frames TF
<noscript> Defines an alternate content for users that do not support client-side scripts STF
<object> Defines an embedded object STF
<ol> Defines an ordered list STF
<optgroup> Defines a group of related options in a drop-down list STF
<option> Defines an option in a drop-down list STF
<p> Defines a paragraph STF
<param /> Defines a parameter for an object STF
<pre> Defines preformatted text STF
<q> Defines a short quotation STF
<s> Deprecated. Defines strikethrough text TF
<samp> Defines sample output from a computer program STF
<script> Defines a client-side script STF
<select> Defines a drop-down list STF
<small> Defines smaller text STF
<span> Defines a section in a document STF
<strike> Deprecated. Defines strikethrough text TF
<strong> Defines strong text STF
<style> Defines style information for a document STF
<sub> Defines subscripted text STF
<sup> Defines superscripted text STF
<table> Defines a table STF
<tbody> Groups the body content in a table STF
<td> Defines a cell in a table STF
<textarea> Defines a multiline input control (text area) STF
<tfoot> Groups the footer content in a table STF
<th> Defines a header cell in a table STF
<thead> Groups the header content in a table STF
<title> Defines a title for the document STF
<tr> Defines a row in a table STF
<tt> Defines teletype text STF
<u> Deprecated. Defines underlined text TF
<ul> Defines an unordered list STF
<var> Defines a variable STF
<xmp> Deprecated. Defines preformatted text



Tag Description DTD
Basic
<!DOCTYPE>  Defines the document type STF
<html> Defines an HTML document STF
<body> Defines the document's body STF
<h1> to <h6> Defines HTML headings STF
<p> Defines a paragraph STF
<br /> Inserts a single line break STF
<hr /> Defines a horizontal line STF
<!--...--> Defines a comment STF
Formatting

<acronym> Defines an acronym STF
<abbr> Defines an abbreviation STF
<address> Defines contact information for the author/owner of a document STF
<b> Defines bold text STF
<bdo> Overrides the current text direction STF
<big> Defines big text STF
<blockquote> Defines a long quotation STF
<center> Deprecated. Defines centered text TF
<cite> Defines a citation STF
<code> Defines a piece of computer code STF
<del> Defines text that has been deleted from a document STF
<dfn> Defines a definition term STF
<em> Defines emphasized text  STF
<font> Deprecated. Defines font, color, and size for text TF
<i> Defines italic text STF
<ins> Defines text that has been inserted into a document STF
<kbd> Defines keyboard input STF
<pre> Defines preformatted text STF
<q> Defines a short quotation STF
<s> Deprecated. Defines strikethrough text TF
<samp> Defines sample output from a computer program STF
<small> Defines smaller text STF
<strike> Deprecated. Defines strikethrough text TF
<strong> Defines strong text STF
<sub> Defines subscripted text STF
<sup> Defines superscripted text STF
<tt> Defines teletype text STF
<u> Deprecated. Defines underlined text TF
<var> Defines a variable STF
<xmp> Deprecated. Defines preformatted text
Forms

<form> Defines an HTML form for user input STF
<input /> Defines an input control STF
<textarea> Defines a multiline input control (text area) STF
<button> Defines a clickable button STF
<select> Defines a drop-down list STF
<optgroup> Defines a group of related options in a drop-down list STF
<option> Defines an option in a drop-down list STF
<label> Defines a label for an <input> element STF
<fieldset> Groups related elements in a form STF
<legend> Defines a caption for a <fieldset> element STF
Frames

<frame /> Defines a window (a frame) in a frameset F
<frameset> Defines a set of frames F
<noframes> Defines an alternate content for users that do not support frames TF
<iframe> Defines an inline frame TF
Images

<img /> Defines an image STF
<map> Defines an image-map  STF
<area /> Defines an area inside an image-map STF
Links

<a> Defines an anchor STF
<link /> Defines the relationship between a document and an external resource STF
Lists

<ul> Defines an unordered list STF
<ol> Defines an ordered list STF
<li> Defines a list item STF
<dir> Deprecated. Defines a directory list TF
<dl> Defines a definition list STF
<dt> Defines an item in a definition list STF
<dd> Defines a description of an item in a definition list STF
<menu> Deprecated. Defines a menu list TF
Tables

<table> Defines a table STF
<caption> Defines a table caption STF
<th> Defines a header cell in a table STF
<tr> Defines a row in a table STF
<td> Defines a cell in a table STF
<thead> Groups the header content in a table STF
<tbody> Groups the body content in a table STF
<tfoot> Groups the footer content in a table STF
<col /> Defines attribute values for one or more columns in a table STF
<colgroup> Defines a group of columns in a table for formatting STF
Styles

<style> Defines style information for a document STF
<div> Defines a section in a document STF
<span> Defines a section in a document STF
Meta Info

<head> Defines information about the document STF
<title> Defines the document title STF
<meta> Defines metadata about an HTML document STF
<base /> Specifies the base URL/target for all relative URLs in a document STF
<basefont /> Deprecated. Specifies a default color, size, or font for all the text in a document TF
Programming

<script> Defines a client-side script STF
<noscript> Defines an alternate content for users that do not support client-side scripts STF
<applet> Deprecated. Defines an embedded applet TF
<object> Defines an embedded object STF
<param /> Defines a parameter for an object STF
[Read More...]


HTML Tutorial Part-3



HTML Attributes

    HTML elements can have attributes
    Attributes provide additional information about an element
    Attributes are always specified in the start tag
    Attributes come in name/value pairs like: name="value"

Attribute Example:

HTML links are defined with the <a> tag. The link address is specified in the href attribute:
<a href="http://www.webtutorial2.blogspot.com">This is a link</a>

Always Quote Attribute Values

Attribute values should always be enclosed in quotes.
Double style quotes are the most common, but single style quotes are also allowed.

Tip: In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes: name='John "ShotGun" Nelson'

HTML Tip: Use Lowercase Attributes

Attribute names and attribute values are case-insensitive.
However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation.

Newer versions of (X)HTML will demand lowercase attributes.
[Read More...]


HTML Tutorial Part-2



Editing HTML

HTML can be written and edited using many different editors like Dreamweaver and Visual Studio.
However, in this tutorial we use a plain text editor (like Notepad) to edit HTML. We believe using a plain text editor is the best way to learn HTML.

Use Your Test Web For Learning

We suggest you experiment with everything you learn by editing your web files with a text editor (like Notepad).
Note: If your test web contains HTML markup tags you have not learned, don't panic. You will learn all about it in the next chapters.

HTM or .HTML File Extension?

When you save an HTML file, you can use either the .htm or the .html file extension. There is no difference, it is entirely up to you.

HTML Headings

HTML headings are defined with the <h1> to <h6> tags.
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>

HTML Paragraphs

HTML paragraphs are defined with the <p> tag.
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

HTML Links

HTML links are defined with the <a> tag.
<a href="http://webtutorial2.blogspot.com/">This is a link</a>

HTML Images

HTML images are defined with the <img> tag.
<img src="webtutorial2.jpg" width="104" height="142" alt="webtutorial" />

HTML Elements

An HTML element is everything from the start tag to the end tag:
Start tag *     Element content     End tag *
<p>     This is a paragraph     </p>
<a href="default.htm">     This is a link     </a>
<br />          

* The start tag is often called the opening tag. The end tag is often called the closing tag.

HTML Element Syntax

    An HTML element starts with a start tag / opening tag
    An HTML element ends with an end tag / closing tag
    The element content is everything between the start and the end tag
    Some HTML elements have empty content
    Empty elements are closed in the start tag
    Most HTML elements can have attributes

Tip: You will learn about attributes in the next chapter of this tutorial.

Nested HTML Elements

Most HTML elements can be nested (can contain other HTML elements).
HTML documents consist of nested HTML elements.
HTML Document Example:
<!DOCTYPE html>
<html>

<body>
<p>This is my first paragraph.</p>
</body>

</html>
The example above contains 3 HTML elements.
1. The <p> element.
2. The <body> element.
3. The <html> element.

Don't Forget the End Tag

Some HTML elements might display correctly even if you forget the end tag:
p>This is a paragraph
<p>This is a paragraph
The example above works in most browsers, because the closing tag is considered optional.
Never rely on this. Many HTML elements will produce unexpected results and/or errors if you forget the end tag .

Empty HTML Elements

HTML elements with no content are called empty elements.
<br> is an empty element without a closing tag (the <br> tag defines a line break).
Tip: In XHTML, all elements must be closed. Adding a slash inside the start tag, like <br />, is the proper way of closing empty elements in XHTML (and XML).

HTML Tip: Use Lowercase Tags

HTML tags are not case sensitive: <P> means the same as <p>. Many web sites use uppercase HTML tags.
we use lowercase tags because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in XHTML.

[Read More...]


 
Payza Signup
Return to top of page Copyright © 2011 | Web Tutorial 2 Sponsored byTuli Host BD