Showing posts with label Design. Show all posts
Showing posts with label Design. Show all posts

Friday, 1 May 2015

Bootstrap Website

Creating a website with Bootstrap is easy and fun. If you know HTML and CSS or have a basic knowledge to code them, then you wont have much a problem to code in Bootstrap. Bootstrap used both HTML and CSS properties for designing. It commonly uses the HTML5 doctype.

You should always remember to put the HTML5 doctype declaration and also the lang attribute at the starting of the webpage.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
Body content......
</body>
</html>
Bootstrap is mainly used to create mobile responsive web pages. The good point is that you don't have to view the same big desktop page in your mobile. You don't have always minimize and maximize anytime you want to click a link or view the text. Mobile-first styles are actually a part of the Bootstrap core framework. But in order to get proper mobile rendering you have to add the following meta code in the head section.

<meta name="viewport" content="width=device-width, initial-scale=1">
  • "width=device-width" - This part sets the width of the page to follow the width of the device.
  • "initial-scale=1" - This sets the initial zoom level when the page is first loaded.
Bootstrap also requires a container to wrap site contents. But remember that you cannot put one container inside another. There are mainly two container classes.
  • ".container" - This provides with a fixed width responsive container.
  • ".container-fluid" - This provides with a full width container spreading across the entire width of the viewport.
Container
For Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>My Bootstrap Webpage</h1>
<p>I love learning Bootstrap.</p>
</div>
</body>
</html>
Container-Fluid
For Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<h1>My Bootstrap Webpage</h1>
<p>I love learning Bootstrap.</p>
</div>
</body>
</html>

CSS Links

Links are found in every document. Links are used to click their way from one page to another page. With CSS, we can style links to make them decorative and colorful.

Styling Links

Links can be styled with any CSS property such as color, font-family, background etc. In addition, links can be styled differently depending on what state they are in.

The four link states are:
  • a:link - a normal link, or an unvisited link
  • a:visited - a link that the user had visited
  • a:hover - a link when the user mouses over it
  • a:active - a link at the moment it is clicked
For example:
a:link {color:#FF0000;}
a:visited {color:#00FF00;}
a:hover {color:#FF00FF;}
a:active {color:#0000FF;}

Text Decoration

The text-decoration property is mainly used to remove the underline from the links.

For example:
a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {text-decoration:underline;}
a:active {text-decoration:underline;}

Background Color

The background-color property is used to specify background color for the links.

For example:
a:link {background-color:#0000FF;}
a:visited {background-color:#FF00FF;}
a:hover {background-color:#00FF00;}
a:active {background-color:#FF0000;}

HTML Forms

HTML Forms are used to create different kinds of user inputs.

HTML <form> Tag

HTML <form> tag is used create an HTML form to pass user inputs and data to the server. AN HTML form can contain input elements like text fields, checkbox, radio-buttons, submit-buttons, and more. A form can also contain select lists, textarea, fieldset, and label elements.

The <form> elemts can contain one or more of the following elements.
  • <input>
  • <textarea>
  • <button>
  • <select>
  • <option>
  • <optgroup>
  • <fieldset>
  • <label>
For example:
<form action="form.asp" method="get">
First name: <input type="text" name="fname">
Last Name: <input type="text" name="lname">
<input type="submit" value="Submit">
</form>

HTML <input> Tag

The most important form element is the input element. The <input> element is used to select user information. It specifies an input field where the user can enter data. The input element can vary in different ways, depending on the type attribute. It can be of text types, checkbox, password, radio button, submit button and more.

Text Fields
The text fields are used to create a one-line input field to enter text into.

For example:
<form>
First name: <input type="text" name="fname">
Last Name: <input type="text" name="lname">
</form>
Password Field
The password field are used to create a one-line input field to enter the password. The characters inside the password field are masked that is, it will be shown as asterisks or circles.

For example:
<form>
Password: <input type="password" name="pwd">
</form>
Radio Button
The radio buttons are used to create a radio button which allows the user to select only one of a limited number of choices.

For example:
<form>
<input type="radio" name="sex" value="male">Male
<input type="radio" name="sex" value="female">Female
</form>
Checkboxes
The checkbox are used to create checkboxes that allows the user to select multiple number of options of a limited number of choices.

For example:
<form>
<input type="checkbox" name="web" value="HTML">Hyper Text Markup Language
<input type="checkbox" name="web" value="CSS">Cascading Style Sheets
</form>
Submit Button
A submit button is used to send form data into the server. The data is sent to the page specified in the form's action attribute. The file defined in the action attribute does some action the data it receives.

For example:
<form>
First name: <input type="text" name="fname">
Last Name: <input type="text" name="lname">
<input type="submit" value="Submit">
</form>

HTML <textarea> Tag

The <textarea> tag is used to define a multi-line text input control. A text area can hold an unlimited number of characters, and the text is rendered in a fixed-width font. The size of the textarea can be specified by the cols and rows attributes, or using CSS height and width properties.

For example:
<textarea rows="4" cols="20">
The <textarea> tag is used  to define a multi-line text input control.
 The size of the textarea can be specified by the cols and rows attributes 
 or using CSS height and width properties.
<textarea>

HTML <label> Tag

The <label> tag defines a label for an <input> element. The <label> tag does not render as anything special for the user. However, it provide a usability improvement for mouse users, because if the user clicks on the text within the <label> element, it toggles the control.

For example:
<form>
<label for="male">Male</label>
<input type="radio" name="sex" id="male" value="male">
<label for="female">Female</label>
<input type="radio" name="sex" id="female" value="female">
</form>

HTML <fieldset> Tag

The <fieldset> tag is used to group related elements in a form. It draws a box around the related elements.

For example:
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" size="30">
Email: <input type="text" size="30">
</fieldset>
</form>

HTML <legend> Tag

The <legend> tag is used to specify a caption for the fieldset element.

For example:
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" size="30">
Email: <input type="text" size="30">
</fieldset>
</form>

HTML <select> Tag

The <select> tag is used to create a drop-down list.

For example:
<select>
<option value="HTML">HTML</option>
<option value="CSS">CSS</option>
<option value="JavaScript">JavaScript</option>
<option value="jQuery">jQuery</option>
</select>

HTML <optgroup> Tag

The <optgroup> tag is used to group related options in a drop-down list. It is used when you have a long list of options, and it helps to group realted options, ehich is easier to handle for a user.

For example:
<select>
<optgroup label="Designing">
<option value="HTML">HTML</option>
<option value="CSS">CSS</option>
</optgroup>
<optgroup label="Scripting">
<option value="JavaScript">JavaScript</option>
<option value="jQuery">jQuery</option>
</optgroup>
</select>

HTML <option> Tag

The <option> tag is used to define a option in a drop-down list.

For example:
<select>
<option value="HTML">HTML</option>
<option value="CSS">CSS</option>
<option value="JavaScript">JavaScript</option>
<option value="jQuery">jQuery</option>
</select>

HTML <button> Tag

The <button> tag is used to create a clickable button. Inside the button element, we can put contents like text or images.

For example:
<button type="button">Click Me!</button>

HTML5 <datalist> Tag

The <datalist> tag is used to specify a list of pre-defined options for an input element. The datalist element is used to provide an autocomplete feature on input element. Users can see a drop-down list of pre-defined options as they input data.

For example:
<input list="browsers">
<datalist id="browsers">
<option value="Google Chrome">
<option value="Mozilla Firefox">
<option value="Safari">
</datalist>

HTML5 <keygen> tag

The <keygen> tag specifies a key-pair genator field used for forms. When the form is submitted, the private key is stored locally, and the public key is sent to the server.

For example:
<form action="form.asp" method="get">
Username: <input type="text" name="username">
Encryption: <keygen name="security">
<input type="submit" value="Submit">
</form>

HTML5 <output> tag

The <output> tag represents the result of a calculation.

For example:
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" id="a" value="50">100
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form>

Monday, 27 April 2015

HTML Tables

Tables are used to create tabular data that is, data represented in rows and columns. HTML tables are created using the <table> tag in conjunction with the <tr> and <td> tags. Some also use table to represent web layouts.

HTML <table> Tag

The <table> tag is used to create a HTML table. The <table> tag is used in conjunction with the <tr>, <th> and <td> tag to create a table.

For example:
<table>
<tbody>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tbody>
</table>

HTML <tr> Tag

The <tr> tag is used to define a table row in an HTML table. The <tr> tag contains more than one <th> and <td> tags.

For example:
<table>
<tbody>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tbody>
</table>

HTML <th> Tag

The <th> tag is used to create a header cell in HTML tables. The header cell will be bold and centered and also left-aligned by default.

For example:
<table>
<tbody>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tbody>
</table>

HTML <td> Tag

The <td> tag is used to create standard cells in HTML tables. This cell usually contains the data in the table.

For example:
<table>
<tbody>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tbody>
</table>

HTML <caption> Tag

The <caption> tag is used to define a table caption. The <caption> tag is inserted just after the <table> tag. By default, the caption may be center aligned.

For example:
<table>
<caption>WEB DESIGNING</caption>
<tbody>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tbody>
</table>

HTML <thead> Tag

The <thead> tag is used to group the header contents in an HTML table. The <thead> tag is used in conjuction with the <tbody> and <tfoot> to specify each part of the table.

For example:
<table>
<thead>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
</thead>
<tbody>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tfoot>
</table>

HTML <tbody> Tag

The <tbody> tag is used to group the body contents in an HTML table. The <tbody> tag is used in conjuction with the <thead> and <tfoot> to specify each part of the table.

For example:
<table>
<thead>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
</thead>
<tbody>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tfoot>
</table>

HTML <tfoot> Tag

The <tfoot> tag is used to group the footer contents in an HTML table. The tag is used in conjuction with the <thead> and <tbody> to specify each part of the table.

For example:
<table>
<thead>
<tr>
<th>HTML</th>
<th>CSS</th>
</tr>
</thead>
<tbody>
<tr>
<td>Hyper Text Markup Language</td>
<td>Cascading Style Sheets</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>.html</td>
<td>.css</td>
</tr>
</tfoot>
</table>

HTML <colgroup> Tag

The <colgroup> tag is used to specify a group of one or more columns in a table for formatting. The <colgroup> tag is useful to specify styles for an entire column rather than repeating styles for each cell, for each row.

For example:
<table>
<colgroup>
<col span="2" style="background-color: yellow;"></col
<col style="background-color: red;"></col>
</colgroup>
<tbody>
<tr>
<th>HTML</th>
<th>CSS</th>
<th>JavaScript</th>
</tr>
<tr>
<td>Markup Language</td>
<td>Style Sheet Language</td>
<td>Scripting Language</td>
</tr>
<tr>
<td>.html</td>
<td>.css</td>
<td>.js</td>
</tr>
</tbody>
</table>

HTML <col> Tag

The <col> tag is used to specify column properties for each column within a element. The <col> tag is useful to specify styles for an entire column rather than repeating styles for each cell, for each row.

For example:
<table>
<colgroup>
<col span="2" style="background-color: yellow;"></col
<col style="background-color: red;"></col>
</colgroup>
<tbody>
<tr>
<th>HTML</th>
<th>CSS</th>
<th>JavaScript</th>
</tr>
<tr>
<td>Markup Language</td>
<td>Style Sheet Language</td>
<td>Scripting Language</td>
</tr>
<tr>
<td>.html</td>
<td>.css</td>
<td>.js</td>
</tr>
</tbody>
</table>

Saturday, 25 April 2015

CSS List

WebLearn Tech

The CSS List property allows you to set different list item markers for ordered and unordered list. In HTML, there are two kinds of list, unordered list and ordered list. With CSS, it can be styled further and images can be used as lists.

List Style

The list-style property is used to set all list styles in one declaration. The properties are in the order: list-style-type, list-style-position, list-style-image.

For example:

<!DOCTYPE html>
<html>
<head>
<style>
ul
{
list-style:square url('square.gif');
}
</style>
</head>

<body>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ul>
</body>
</html>

List Style Image

The list-style-image property replaces the list-item marker with an image.

For example:

<!DOCTYPE html>
<html>
<head>
<style>
ul
{
list-style-image:url('square.gif');
}
</style>
</head>

<body>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ul>
</body>
</html>

List Style Position

The list-style-position property is used to specify if the list item markers should appear inside or outside of the content flow.

For example:

<!DOCTYPE html>
<html>
<head>
<style>
ul.a {list-style-position:inside; }
ul.b {list-style-position:outside; }
</style>
</head>

<body>
<p>The following list has the list-style-position inside:</p>
<ul class="a">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ul>

<p>The following list has the list-style-position outside:</p>
<ul class="b">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ul>
</body>
</html>

List Style Type

The list-style-type property is used to specify the type of list-item in a list.

For example:

<!DOCTYPE html>
<html>
<head>
<style>
ul.a {list-style-type:circle; }
ul.b {list-style-type:square; }
ol.c {list-style-type:upper-roman; }
ol.d {list-style-type:lower-alpha; }
</style>
</head>

<body>
<p>Example of unordered lists:</p>

<ul class="a">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ul>

<ul class="b">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ul>

<p>Example of ordered lists:</p>

<ol class="c">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ol>

<ol class="d">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ol>

</body>
</html>

HTML Sections

HTML elements can be grouped together for various content. Some of the common used tags are <div> and <span>. We can use <div> to display the header section or footer section. But, in HTML5, new tags such as <nav>, <header>, <footer> reduce the tag consumption used in <div> element.

HTML <div> Tag

The <div> tag is used as a block level element that can be used as a container for grouping other HTML elements. The <div> tag has no special meaning, except that it displays a line break before and after the tag. When used with CSS, it can be styled to our desire. It is also used to describe web page layouts.

For example:
<div>
<h1>This is a heading</h1>
<p>This is a paragraph</p>
</div>

HTML <span> Tag

The <span> tag is an inline element that can be used as a container for text. When used with CSS, it can be used to style the text.

For example:
My friend has <span style="color: brown">brown</span&gt: eyes.

HTML5 <header> Tag

The <header> tag is used to specify the header of the document or section. It should be used as the container for introductory contents.

For example:
<header>
<h1>HTML</h1>
<p>HTML means Hyper Text Markup Language</p>
</header>

HTML5 <section> Tag

The <section> tag id used to define a section in a document. A section is a used for grouping of content, typically with a heading.

For example:
<section>
<h1>HTML</h1>
<p>HTML means Hyper Text Markup Language</p>
</section>

HTML5 <article> Tag

The <article> tag is used to specify independent, self-contained content. An article should make sense on its own and it should be possible to distribute it independently.

For example:
<article>
<h1>HTML</h1>
<p>HTML means Hyper Text Markup Language</p>
</article>

HTML5 <aside> Tag

The <aside> tag is used to specify some content aside from the content it is placed in.

For example:
<aside>
<h1>HTML</h1>
<p>HTML means Hyper Text Markup Language</p>
</aside>

HTML5 <footer> Tag

The <footer> tag specifies the footer of the document or section. A footer usually contains the name of author, copyright information, links to term of use, contact information etc.

For example:
<footer>
<p>Posted by: Hege Refsnes</p>
<p>Contact information: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

HTML5 <details> tag

The <details> tag specifies additional details that the user can view or hide on demand. It can be used to create an interactive widget that the user can open and close. Any sort of content can be put inside the <details> tag.

For example:
<details>
<summary>Copyright.</summary>
<p>by Edwin Ronald Lambert.</p>
<p>HTML is fun.</p>
</details>

HTML5 <dialog> Tag

The <dialog> tag is used to define dialog box or a window. The <dialog> element makes it easy to create popup dialog and modal in a web page.

For example:
<dialog open>This is a dialog!</dialog>

HTML5 <summary> Tag

The <summary> tag is used to define a visible heading for the <details> element. The heading can be clicked to view/hide the details.

For example:
<details>
<summary>Copyright 2014 </summary>
<p>Posted by: Edwin Ronald Lambert</p>
<p>All Rights Reserved</p>
<details>

HTML <iframe> Tag

The <iframe> tag is used to display an inline frame. That is to display a web page within a web page. It is used to embed another document inside the current document.

For example:

<iframe src="http://weblearntech.blogspot.in/"></iframe>

Friday, 24 April 2015

What is Bootstrap?

Bootstrap is a powerful free front-end framework for faster and better web development. Bootstrap includes HTML and also CSS based designs for typography, layout, forms, buttons, images etc. It also contains many JavaScript plugins. Bootstrap also has the ability to create responsive websites. Responsive websites are those websites that automatically adjust their design so as to work perfectly in all devices ranging from smart phones to desktop PC.

Bootstrap was developed by Mark Otto and Jacob Thornton at Twitter, and released as an open source product in August 2011 on GitHub.

Advantages of Bootstrap

  • It is easy to use: Anybody who knows basic knowledge in HTML and CSS can design using Bootstrap.
  • Responsive: Used to create responsive pages which adjust automatically as the device needs.
  • Mobile-first framework: Mobile-first are also a part of the core framework.
  • Browser compatible: Bootstrap is compatible with all browsers now a days.

Get Bootstrap

There are two ways by which you can access Bootstrap.

Bootstrap CDN

You can also host Boostrap yourself, you can just include it from a CDN (Content Delivery Network). MaxCDN provides the CDN support fot Boostrap.

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">

Thursday, 23 April 2015

HTML Multimedia

Multimedia comes in different format. It can be pictures, audio, video, animation and much more. Modern web pages often have embedded multimedia elements and supports various multimedia format.

Multimedia Formats

Multimedia elements like audio and video are stored in media files. The most common way to look up a media file is to look its extension.

HTML5 <audio> Tag

Before HTML5, audio was played with a plug-in. HTML5
<audio controls>
<source src="song.ogg" type="audio/ogg"></source>
<source src="song.mp3" type="audio/mpeg"></source>
<source src="song.wav" type="audio/wav"></source>
</audio>

Audio Formats
MIDI .mid
.midi
MIDI (Musical Instrument Digital Interface) is a format for electronic music devices.
RealAudio .rm
.ram
RealAudio was developed to allow streaming of audio with low bandwidth.
WMA .wma WMA files can be delivered as a continuous flow of data, which make it practical for use in Internet Radio.
AAC .aac AAC was developed by Apple as the default format for iTunes.
WAC .wav WAV is compatible with Windows, Macintosh and Linux.
Ogg .ogg Ogg was developed by Xiph.Org Foundation.
MP3 .mp3 MP3 is the most popular sound format. It is supported in all major browsers.

HTML5 <video> Tag

Before HTML5, video was played with a plug-in. HTML5 <video> element is used with which one can embed video files on a web page. HTML5 on supports MP4, WebM and Ogg video file.

For example:
<video height="240" width="320" controls>
<source src="movie.ogg" type="video/ogg"></source>
<source src="movie.mp4" type="video/mp4"></source>
<source src="movie.webm" type="video/webm"></source>
</video>

Video Format
AVI .avi AVI was developed by Microsoft, therefore can be played in Windows Computer.
WMV .wmv WMV was developed by Microsoft, therefore can be played in Windows Computer.
Quicktime .mov Quicktime was developed by Apple, therefore can be played in Apple Computer.
RealVideo .rm
.ram
RealVideo was developed to allow streaming of audio with low bandwidth.
Flash .swf
.flv
Flash was developed by macromedia.
Ogg .ogg Ogg was developed by Xiph.Org Foundation.
WebM .webm WebM is a project by the web giants Mozilla, Opera, Adobe and Google.
MPEG .mpg
.mpeg
MPEG is the most popular video format in the internet.
MPEG-4 or MP4 .mp4 MP4 is the upcoming video format of the internet.

HTML5 <source> Tag

The <source> tag is used to specify multiple media resources for media elements such as <audio> and <video>. The <source> tag allows you to specify alternate video or audio files which the browser may choose from, based on its media types and codec support.

For example:
<audio controls>
<source src="song.ogg" type="audio/ogg">
<source src="song.mp3" type="audio/mpeg">
<source src="song.wav" type="audio/wav">
</audio>

HTML5 <track> Tag

The <track> tag is used to specify text tracks for media elements. This element is used to specify subtitles, caption files or other files containing text, that should be visible while the media is playing.

For example:
<video width="320" height="240" controls>
<source src="movie.ogg" type="video/ogg">
<source src="movie.mp4" type="video/mp4">
<source src="movie.webm" type="video/webm">
<track src="subtitles_en.vtt" kind="subtitle" srclang="en" label="English">
</video>

HTML Plug-ins

Plug-ins are used to extend the functionality of the HTML browser. A plug-in is a small computer program that can be used for many purpose: to display maps, scan for viruses and much more. Some of the well-known plug-ins are java applets and Adobe flash player. Plug-ins are added using the <object> tag and <embed> tag.

HTML <object> Tag
The <object> tag is used to define an embedded object within an HTML document. It is supported by all major browsers. It is used to embed plug-ins in Web pages.

For example:
Audio:
<object height="50" width="100" data="song.mp3"></object>
Video:
<object data="movie.mp4" height="200" width="200"></object>
HTML <embed> Tag
The <embed> tag is used to define a container for an external application or interactive content. It is supporteddi in all major browsers

For example:
Audio:
<embed height="50" width="100" data="song.mp3">
Video:
<embed src="movie.mp4" height="200" width="200">
HTML <param> Tag
The <param> tag is used to define parameters for plug-ins embedded with <object> tag.

For example:
<object data="song.mp3">
<param name="autoplay" value="true">
</object>

CSS Text Formatting

HTML text can be styled using CSS. Text formatting properties are used for this purpose.

Text Color

The color property is used to color the HTML text. In CSS, color options can be given by three different ways:
  • HEX value - #000000
  • RGB value - rgb(0,0,0)
  • Color name - Black
For example:
<!DOCTYPE html>
<html>

<head>
<style>
h1.color {color:red;}
p.color {color:blue;}
</style>
</head>

<body>
<h1 class="color">This is a Heading</h1>
<p class="color">This is a paragraph</p>
</body>
</html>

Direction

The direction property is used to denote the text direction or the direction in which the text is written.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.dir {direction:rtl;}
</style>
</head>

<body>
<p>This paragraph is in default direction.</p>
<p class="dir">This paragraph is from right to left.</p>
</body>
</html>

Letter Spacing

The letter-spacing property is used to increase or decrease the space between the characters in a text.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
h1.letter_space {letter-spacing:3px;}
h2.letter_space {letter-spacing:-3px}
</style>
</head>

<body>
<h1 class="letter_space">This is a Heading</h1>
<h2 class="letter_space">This is a Heading</h2>
</body>
</html>

Line Height

The line-height property is used to specify the height of each line.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.small {line-height:50%;}
p.big {line-height:200%;}
</style>
</head>

<body>
<p class="small">This is a paragraph
This is a paragraph
This is a paragraph</p>
<p class="big">This is a paragraph
This is a paragraph
This is a paragraph</p>
</body>
</html>

Text Align

The text-align property is used to horizontally align the text.

For example:

<!DOCTYPE html>
<html>

<head>
<style>
h1.align {text-align:left;}
h2.align {text-align:center;}
h3.align {text-align:right;}
</style>
</head>

<body>
<h1 class="align">This is a Heading</h1>
<h2 class="align">This is a Heading</h2>
<h3 class="align">This is a Heading&lt/h3>
</body>
</html>

Text Decoration

The text-decoration property is used to specify the decoration added to the element.

For example:

<!DOCTYPE html>
<html>

<head>
<style>
h1.decoration {text-decoration:overline;}
h2.decoration {text-decoration:line-through;}
h3.decoration {text-decoration:underline;}
</style>
</head>

<body>
<h11 class="decoration">This is a Heading</h1>
<h21 class="decoration">This is a Heading</h2>
<h31 class="decoration">This is a Heading</h3>
</body>
</html>

Text Indent

The text-indent property is used to specify the indentation of the first line of the text.

For example:

<!DOCTYPE html>
<html>

<head>
<style>
p.indent {text-indent:50px;}
</style>
</head>

<body>
<p class="indent">CSS is used to control the style and layout of multiple 
web pages. It defines how to style HTML elements. An HTML element can be 
 displayed with different styles using CSS.</p>
</body>
</html>

Text Shadow

The text-shadow property is used to add shadow to text element.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
h1.shadow {text-shadow:5px 5px #ffffff;}
</style>
</head>

<body>
<h1 class="shadow">This Heading have Shadow</h1>
</body>
</html>

Text Transform

The text-property is used to specify the capitalization of the text element.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.uppercase {text-transform:uppercase;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}
</style>
</head>

<body>
<p class="uppercase">This is a Paragraph</p>
<p class="lowercase">This is a Paragraph</p>
<p class="capitalize">This is a Paragraph</p>
</body>
</html>

Unicode Bi-Directional Text

The unicode-bidi property is used along with the direction property to set whether the text should be overridden to support multiple languages.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.dir_bidi {direction:rtl;
unicode-bidi:bidi-override;}
</style>
</head>

<body>
<p>This paragraph is in default direction.</p>
<p class="dir_bidi">This paragraph is from right to left.</p>
</body>
</html>

Vertical Align

The vertical-align property is used to set the vertical align of a text element.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
img.top {vertical-align:top;}
img.bottom {vertical-align:botoom;}
</style>
</head>

<body>
<p>This <img class="top" src="Birds.jpg" />paragraph is  at the top of the 
 image.</p>
<p>This <img class="bottom" src="Birds.jpg" />paragraph is  at the bottom
  of the image.</p>
</body>
</html>

White Space

The white-space property is used to specify how to handle white spaces inside an HTML document.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.white_space {white-space:nowrap}
</style>
</head>

<body>
<p class="white_space">This is a paragraph. This is another paragraph. This 
 is yet another paragraph and so the number of paragraphs continues.</p>
</body>
</html>

Word Spacing

The word-spacing property is used to increase or decrease the white space between words.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.word_space {word-spacing:20px}
</style>
</head>

<body>
<p class="word_space">This is a paragraph.</p>
</body>
</html>

Wednesday, 22 April 2015

HTML Images

HTML has the function to add images also. Adding images, increases the design and creativity of the page. Today, almost all web pages have images.

HTML <img> Tag

In HTML, images are added using the <img> tag. It is an empty tag, so there is no need of closing it. To display the images, you will have to use the "src" attribute to find the destination source of the image.

For example:
<img src="web.jpg">

We use the "alt" attribute to specify an alternate text, when the image is not displayed or the source of the image is broken. We can give any text to the alt attribute value, because they are author-defined text.

For example:
<img alt="Web" src="web.jpg">

The "height" and "width" attribute are used to specify the height and width of the image. It is specified in pixels.
For example:
<img alt="Web" height="100px" src="web.jpg" width="100px">

HTML <map> Tag

The <map> tag is used to define a client-side image map. An image map is a image which have clickable areas. The "name" attribute of the image map is associated with the images usemap attribute to create a relation between them. The <map> tag contains area element, that defines clickable areas.

For example:
<img alt="Web" br="" height="100px" src="web.jpg" width="100px" usemap=#web>
<map name="#web">
<area alt="HTML" coords="80, 92, 95" href="html.html" shape="poly"></area>
<area alt="CSS" coords="180, 92, 105" href="css.html" shape="circle"></area>
<area alt="Bootstrap" coords="180, 120, 95" href="bootstrap.html" shape="poly"></area>
</map>

HTML <area> Tag

The <area> tag is used to define a clickable area inside a image map. It is always nested inside the map element.

For example:
<img alt="Web" br="" height="100px" src="web.jpg" width="100px" usemap=#web>
<map name="#web">
<area alt="HTML" coords="80, 92, 95" href="html.html" shape="poly"></area>
<area alt="CSS" coords="180, 92, 105" href="css.html" shape="circle"></area>
<area alt="Bootstrap" coords="180, 120, 95" href="bootstrap.html" shape="poly"></area>
</map>

HTML <canvas> Tag

The <canvas> tag is used to draw graphics using scripts mainly JavaScript. The <canvas> tag is just a container for the graphics, we have to use javaScript to draw the graphics.

For example:
<canvas id="myCanvas"></canvas>
<script>
var canvas=document.getElementById('myCanvas');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#FFFF00';
ctx.fillRect(0,0,100,100);
</script>

HTML <figure> Tag

the <figure> tag is used to specify a self-contained content like illustration, diagrams, photos, code listing etc.

For example:
<figure>
<img alt="Web" height="100px" src="web.jpg" width="100px">
</figure>

HTML <figcaption> Tag

The <figcaption> tag used to define a caption to the figure. The <figcaption> element can be placed as the first or last child of the <figure> element.

For example:
<figure>
<img alt="Web" height="100px" src="web.jpg" width="100px">
<figcaption>Fig1 : The picture of web languages</figcaption>
</figure>

Sunday, 19 April 2015

HTML Links

A link is group of words or images used to jump from one page to another. They are the most fundamental tag in the HTML page. So they are found mainly in all websites.

HTML <a> Tag

A <a> tag is used to jump from one page to another. It is used to display hyperlinks. When you rollover the cursor above the link, it turn into a little hand. The "href" attribute is used to denote the source of the link. It denotes the destination of the link.

For example:
<a href="https://www.blogger.com/index.html">HOME</a>
The target attribute is used to specify where to open the document. The target attribute can be given the following values:
  • _blank
  • _parent
  • _self
  • _top
For example:
<a href="https://www.blogger.com/index.html" target="_blank">HOME</a>
The id attribute is used to create bookmark inside the document itself.
<a href="#html5">See HTML5 Section</a>
<a id="html5">Introduction to HTML5</a>

For example:
<a href="#C10">See Chapter 10</a>
<h1>Chapter 1</h1>
<h1>Chapter 2</h1>
<h1>Chapter 3</h1>
<h1>Chapter 4</h1>
<h1>Chapter 5</h1>
<h1>Chapter 6</h1>
<h1>Chapter 7</h1>
<h1>Chapter 8</h1>
<h1>Chapter 9</h1>
<h1><a id="C10">Chapter 10</a></h1>
<h1>Chapter 11</h1>
<h1>Chapter 12</h1>
<h1>Chapter 13</h1>
<h1>Chapter 14</h1>
<h1>Chapter 15</h1>
<h1>Chapter 16</h1>
<h1>Chapter 17</h1>
<h1>Chapter 18</h1>
<h1>Chapter 19</h1>
<h1>Chapter 20</h1>
Hyperlinks can also be used to link email address. For that, we use the mailto:email_address in the href attribute.

For example:
<a href="mailto:edwinronaldlambert30@gmail.com">Send Mail</a>

HTML <nav> Tag

The <nav> tag is used to denote a set of navigation links. All the links inside the nav element will be regarded as a navigation link.

For example:
<nav>
<a href="https://www.blogger.com/html">HTML</a> |
<a href="https://www.blogger.com/css">CSS</a> |
<a href="https://www.blogger.com/javascript">JavaScript</a> |
<a href="https://www.blogger.com/jquery">jQuery</a>
</nav>

Introduction to Bootstrap 3

Bootstrap 3
Bootstrap is a powerful and popular HTML, CSS, and JavaScript framework for creating responsive, mobile-first websites for faster and easier web develpoing. It can be designed by everyone who knows a little knowledge of HTML, CSS or JavaScript or all. It is user-friendly and is made for folks of all skill levels, devices of all shapes, and projects of all sizes.

Bootstrap is completely free to download. Download it here - getbootstrap.com.

For example:
<div class="container">
  <div class="jumbotron">
    <h1>My First Page</h1>
    <p>Resize this page and see the magic!</p>
  </div>
  <div class="row">
    <div class="col-sm-4">
      <h3>Column 1</h3>
      <p>This is just a sample text...</p>
      <p>This is just a sample text...This is just a sample text...</p>
    </div>
    <div class="col-sm-4">
      <h3>Column 2</h3>
      <p>This is just a sample text...</p>
      <p>This is just a sample text...This is just a sample text...</p>
    </div>
    <div class="col-sm-4">
      <h3>Column 3</h3>
      <p>This is just a sample text...</p>
      <p>This is just a sample text...This is just a sample text...</p>
    </div>
  </div>
</div>

Wednesday, 15 April 2015

CSS Font

The CSS Font property defines the font family, boldness, size and style of the text

Font

The font property is used to set all the font properties in one declaration. The font properties are set in the order of "font-style, font-variant, font-weight, font-size, font-family."

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.html_font {font:"italic bold 15px "Georgia, Serif;}
</style>
</head>

<body>
<p class="html_font">Hyper Text Markup Language</p>
</body>

</html>

Font Family

The font family of a text is set with the font-family property. The font-family property should contain several font names, so that the next font will be displayed if the first font is not present. If the names of the font is more than one word, then it should be contained in a pair of double quotes like "Times New Roman". If there are more than one font, then it should be separated by commas.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.html_fontfamily {font-family:"Times New Roman", Times, Serif;}
p.css_fontfamily {font-family:Arial, Helvetica, sans-serif;}
</style>
</head>

<body>
<p class="html_fontfamily">Hyper Text Markup Language</p>
<p class="css_fontfamily">Cascading Style Sheets</p>
</body>

</html>

Font Size

The font-size property sets the size of the text. Managing the text size is important, but it should not be used to make the text look like heading or so. The font-size value can be absolute or relative size. Font size can be denoted in percentage, pixels, and in emphemeral unit (em).

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.html_size {font-size:90%;}
p.css_size {font-size:10px;}
p.javascript_size (font-size:1.5em;)
</style>
</head>

<body>
<p class="html_size">Hyper Text Markup Language</p>
<p class="css_size">Cascading Style Sheets</p>
<p class="javascript_size">JavaScript</p>
</body>

</html>

Font Style

The font-style property is commonly used to style text. This property has the following values:
  • normal
  • italic
  • oblique
For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.html_style {font-style:normal;}
p.css_style {font-style:italic;}
p.javascript_style {font-style:oblique;}
</style>
</head>

<body>
<p class="html_style">Hyper Text Markup Language</p>
<p class="css_style">Cascading Style Sheets</p>
<p class="javascript_style">JavaScript</p>
</body>

</html>

Font Variant

The font-variant property is used to display the text into a small-caps form. In the small-caps font, all lowercase characters are transformed into upper characters, but will be somewhat smaller in size.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.html_variant {font-variant:normal;}
p.css_variant {font-variant:small-caps;}
</style>
</head>

<body>
<p class="html_variant">Hyper Text Markup Language</p>
<p class="css_variant">Cascading Style Sheets</p>
</body>

</html>

Font Weight

The font-weight property is used to make the text thick or thin.

For example:
<!DOCTYPE html>
<html>

<head>
<style>
p.html_weight {font-weight:normal;}
p.css_weight {font-weight:lighter;}
p.javacript_weight {font-weight:bolder;}
p.jquery_weight {font-weight:100;}
</style>
</head>

<body>
<p class="html_weight">Hyper Text Markup Language</p>
<p class="css_weight">Cascading Style Sheets</p>
<p class="javascript_weight">JavaScript</p>
<p class="jquery_weight">jQuery</p>
</body>

</html>

Sunday, 5 April 2015

CSS Background

CSS background property is used to define the background properties of an element. The background properties used in CSS are:
  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background position

Background

There are many properties when dealing with CSS backgrounds. So to shorten the code, it is best to specify all the properties in a single property. This is called the shorthand property of background. There is no problem if one of the content is missing as long as the ones that are present are in correct order.

For example:
body { 
background:#ffffff url('logo.png') no-repeat fixed top; 
}

Background Color

The background-color property is used to specify the background color of an element. The background color of a page should be declared in the body itself.
In CSS, color options can be given by three different ways:
  • HEX value - #000000
  • RGB value - rgb(0,0,0)
  • Color name - Black
For example:
body { background-color:#e0ffff; }

Background Image

The background-image property is used to specify a background picture in an HTML page. By default, the background image will be repeated to cover all area.

For example:
body { background-image:url("image.png") }

Background Repeat

By default, the background image will be repeated both horizontally and vertically so that it will cover all the region. But using the background-repeat property, we can adjust the repeating option of the image file.
We can adjust the image in the following four ways
  • repeat - Default option, the image will be repeated both horizontally and vertically
  • repeat-x - The image will be repeated horizontally only.
  • repeat-y - The image will be repeated vertically only
  • no-repeat - The image will not be repeated.
For example:
body { background-image:url("image.png"); 
       background-repeat:repeat-x; 
     }

Background Position

The background-position property is used to adjust the position of the image file to a specific position so that it does not disturb the elements.

For example:
body { background-image:url("image.png"); 
       background-repeat:repeat-x; 
       background-position:center; 
     }

Background Attachment

The background-attachment property is used to set whether the image is fixed or it scrolls with the element.
We can attach the elements in the following ways
  • scroll - The background scrolls along with the element.
  • fixed - The background is fixed.
  • local - The background scrolls along with the element's contents.
For example:
body { background-image:url("image.png"); 
       background-repeat:repeat-x; 
       background-position:center; 
       background-attachment:fixed;
     }

HTML Lists

Lists are used to order things or objects of the same category. They are used to number these objects according to a number. The most common types of lists are ordered list and unordered list.

Ordered List

The <ol> tag is used to denote an ordered lists. The ordered lists can be numerical or alphabetical in order.

Ordered lists can be denoted in the following types:

  • 1 - Represented in numerical order
  • A - Represented in uppercase alphabetical order
  • a - Represented in lowercase alphabetical order
  • I - Represented in uppercase roman numerals
  • i - Represented in lowercase roman numerals
For example:
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>

Unordered List

The <ul> tag is used to denote an unordered lists. The unordered lists are bulleted in order.

Unordered lists can be denoted in the following types:

  • disc - Represented in disc shape
  • square - Represented in square shape
  • circle - Represented in circle shape
For example:
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>

List Item

The <li> tag is used to denote a list item. List items are used in ordered list, unordered list and menu list.

For example:
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>

<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>

Definition List

A definition list is a list of terms with a description of each term. The <dl> tag is used to denote a definition list. The <dl> tag is used in conjunction with the <dt> tag (Definition Term) and the <dd> tag (Definition Data). The <dt> tag is used to define a term name in the definition list and the <dd> tag is used to describe the term name in the definition list.

For example:
<dl>
<dt>HTML</dt>
<dd>Used to describe web pages.</dd>
<dt>CSS</dt>
<dd>Used to style web pages.</dd>
</dl>

Menu List

The <menu> tag denotes a menu list. The menu list is used to define a list of commands. It is also used for context menus, toolbar and for listing forming controls and commands. In fact, menu element is not supported in any browser at the present.

For example:
<menu type="web">
<li>
<button type="button" onclick="file_new()">New</button>
<button type="button" onclick="file_open()">Open</button>
<button type="button" onclick="file_save()">Save</button>
</li>
</menu>

The <menuitem> Tag

The <menuitem> tag defines a menu that the user can invoke from a pop-up menu. Currently, this function is supported in Firefox only.

For example:
<menu type="context" id="mymenu">
<menuitem label="Refresh" onclick="windows.location.reload()" 
 icon="ico_reload.png">
</menuitem>
</menu>

Saturday, 4 April 2015

HTML Text Formatting

HTML has different tags for different purpose. One such purpose is formatting text. In HTML, we can give headings, give styles to text and so on. It is thee function ehich make HTML easy to handle.

HTML Headings

Headings are important in HTML. Heading are given to mark the beginning or to know what the content is about.

Headings are defined using <h1> to <h6> tags. <h1> tag describe the most important heading and is the biggest heading of all. <h6> tag describes the least important heading and is the smallest of all.

Attributes
align left
center
right
justify
Specifies the alignment of a heading

For example:
<h1>This is a heading.</h1>
<h2>This is a heading.</h2>
<h3>This is a heading.</h3>
<h4>This is a heading.</h4>
<h5>This is a heading.</h5>
<h6>This is a heading.</h6>

HTML Paragraphs

Paragraphs are used to separate the content to separate sections. The paragraphs are defined using <p> tag.

Attributes
align left
center
right
justify
Specifies the alignment of the text within a paragraph

For example:
<p>This is a paragraph</p>
<p>This is another paragraph</p>

HTML Line Breaks

Line Break is the same function as Enter key in Microsoft Word. It is used to break the line and to start the continuous sentence in the next line. The line break is defined using the <br> tag. Note that <br> is an empty tag, so it does not contain a closing tag.

For example:
This is a sentence <br> with line breaks.

HTML Formatting Tags

HTML language uses text formatting tags to style HTML contents. These tags are used to edit the pages of the HTML document.

Text Formatting Tags
Text formatting tags are commonly used for editing text. The text formatting tags are:
Bold (<b> and </b>) Defines bold text
Emphasized (<em> and </em>) Defines emphasized text
Italics (<i> and </i>) Defines italics text
Small (<small> and </small>) Defines small text
Strong (<strong> and </strong>) Defines strong text
Subscript (<sub> and </sub>) Defines subscripted text
Superscript (<sup> and </sup>) Defines superscripted text
Underline (<u> and </u>) Defines underlined text
Strike-Through (<s> and </s>) Defines striked text
Insert (<ins> and </ins>) Defines inserted text
Delete (<del> and </del>) Defines deleted text
Word Break Opportunity (<wbr>) Defines where it is ok to add a line break in the text
Marked (<mark> and </mark>) Defines marked/highlighted text

For example:
<b>This text is bold.</b>
<em>This text is emphasized.</em>
<i>This text is italics.</i>
<small>This text is small.</small>
<strong>This text is strong.</strong>
This text is <sub>subscript</sub> and this text is <sup>superscript.</sup>
This text is <u>underlined.</u>
This text is <s>striked</s>
This text is <ins>inserted</ins> and this text is <del>deleted.</del>
This text has <wbr>line break<wbr> here.
This text is <mark>marked.</mark>

Computer Output Tags
Computer output tags are used to write data in a computer coded manner. It is useful in writing codes and programs. The computer output tags are:
Computer Code (<code> and </code>) Defines computer code text
Keyboard Input (<kbd> and </kbd>) Defines keyboard text
Sample Computer Code (<samp> and </samp>) Defines sample computer code
Variable (<var> and </var>) Defines a variable
Preformatted Text (<pre> and </pre>) Defines preformatted text

For example:
<code>This is a computer coded text.</code>
<kbd>This is keyboard text.</kbd>
<samp>This is a sample computer coded text.</samp>
<var>This is a variable.</var>
<pre>This is a
preformatted   text</pre>

HTML Citations, Quotation and Definition Tags
These tags are used to give information regarding the page and also giving an inline quotation and so on.
Abbreviation (<abbr> and </abbr>) Defines a abbreviation or acronym.
Address (<address> and </address>) Defines contact information for the owner/author of the document.
Bi-Directional Override (<bdo> and </bdo>) Defines the direction of the text.
Blockquote (<blockquote> and </blockquote>) Defines a section that is quoted from other source.
Quotation (<q> and </q>) Defines a short inline quotation.
Citation (<cite> and </cite>) Defines the title of the work.
Definition (<dfn> and </dfn>) Defines a definition term.

For example:
I want it <abbr title="As Soon As Possible">ASAP.</abbr>
<address>
Written by WebLearn Tech
Address: Asokapuram, Aluva
Phone: +91 9746187942
</address>
<bdo dir="rtl">
This sentence is written from right to left.
</bdo>
<blockquote cite="http://en.wikipedia.org/wiki/HTML">HTML or Hyper Text 
 Markup language is the standard markup language used to create webpages.
 </blockquote>
<q>Every moment in our life is precious for us all.</q>
<cite>WWW</cite> was invented by Tim Berners Lee.
<dfn>Definition term</dfn>

HTML Lines

HTML lines are created to separate each content with a line. The <hr> tag is used for this purpose.

Attributes
align left
center
right
Specifies the alignment of a <hr> element
noshade noshade Specifies that a <hr> element should render in one solid color (noshaded),
instead of a shaded color
size pixels Specifies the height of a <hr> element
width pixels
%
Specifies the width of a <hr> element

For example:
<p>This is a paragraph</p>
<hr>
<p>This is another paragraph</p>
<hr>

Friday, 3 April 2015

CSS3

CSS has evolved over time from CSS1 to CSS2(which are the current standard) to CSS3(which is still in development.) CSS3 is the latest standard of CSS. The term "CSS3" is not just a reference to the new features of CSS, but the third level in the progress of the CSS specifications.

It is a language which describes how a document looks and how it is formatted. Modern browsers support CSS1 and CSS2 but the support to CSS3 is limited. CSS3 has been split into modules. It contains the old CSS specifications ans new modules are added. Some of the new modules are:
  • Selectors
  • Box Model
  • Backgrounds and Borders
  • Image Values and Replaced contents
  • Text Effect
  • 2D/3D Transformation
  • Animations
  • Multiple Column Layout
  • User Interface
With CSS3, it is possible to add rounded borders, shadows to boxes, and use an image as border and much more.

Saturday, 29 November 2014

HTML Head and Body

The <head> tag and the <body> tag arethe two important tags used in HTML document. Both of them are essential in creating an HTML document.

HTML <head> Tag

The head element is a container for all head contents. Elements inside the <head> can include scripts, styles, title of the document, metadata, and more.
The following elements can go inside the head section :
HTML <title> Tag
The HTML <title> tag defines the title of the webpage. The title element is essential in an HTML document.

For example:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document..</title>
</li>
</ul>
<body>
Body of the document...
</body>
</html>
HTML <style> Tag
The HTML <style> tag is used to include styles for an HTML document.

Attributes
media media_query Specifies what media/device the media resource is optimized for
scoped scoped Specifies that the styles only apply to this element's parent element
and that element's child elements
type text/css Specifies the MIME type of the style sheet
For example:
<head>
<style type="text/css">
body { background-color:red }
p { color:yellow}
</style>
</head>
HTML <base> Tag
The <base> tag specifies a default address or a default target for all the links in the page.

Attributes
href URL Specifies the base URL for all relative URLs in the page
target _blank
_parent
_self
_top
framename
Specifies the default target for all hyperlinks and forms in the page
For example:
<head>
<base href="http://www.facebook.com/images"></base>
<base target="_blank"></base>
</head>
HTML <link> Tag
The <link> tag defines the relationship between a HTML document and an external source. It is commonly used to link style sheets.

Attributes
charset char_encoding Specifies the character encoding of the linked document
href URL Specifies the location of the linked document
hreflang language_code Specifies the language of the text in the linked document
media media_query Specifies on what device the linked document will be displayed
rel alternate
archives
author
bookmark
external
first
help
icon
last
license
next
nofollow
noreferrer
pingback
prefetch
prev
search
sidebar
stylesheet
tag
up
Required. Specifies the relationship between the current
document and the linked document
rev reversed relationship Specifies the relationship between the linked document
and the current document
sizes HeightxWidth
any
Specifies the size of the linked resource. Only for rel="icon"
target _blank
_self
_top
_parent
frame_name
Specifies where the linked document is to be loaded
type MIME_type Specifies the MIME type of the linked document
For example:
<head>
<link href="styles.css" rel="stylesheet" type="text/css"></link>
</head>
HTML <meta> Tag
The <meta> tag provide the metadata about the HTML document. It will be displayed on the page, but will be machine readable. Meta elements are usually used to specify the description, keywords, author of the document etc.

Attributes
charset character_set Specifies the character encoding for the HTML document
content content Gives the value associated with the http-equiv or name attribute
http-equiv content-type
default-style
refresh
Provides an HTTP header for the information/value of the content
attribute
name application-name
author
description
generator
keywords
Specifies a name for the metadata
scheme format/URI Specifies a scheme to be used to interpret the value of the
content attribute
For example:
<head>
<meta charset="UTF-8">
<meta name="description" content="HTML tutorials">
<meta name="keywords" content="HTML, CSS, Bootstrap">
<meta name="author" content="Edwin Ronald Lambert">
</head>
HTML <script>Tag
The <script> tag is used to define a client-side script, such as JavaScript. The script element usually contains scripting statements or an external file that contains the scripting statements.

Attributes
async async Specifies that the script is executed asynchronously (only for external
scripts)
charset charset Specifies the character encoding used in an external script file
defer defer Specifies that the script is executed when the page has finished parsing
(only for external scripts)
src URL Specifies the URL of an external script file
type MIME-type Specifies the MIME type of the script
xml:space preserve Specifies whether whitespace in code should be preserved

For example:
<head>
<script type="text/javascript">
document.write
("Hello World!")
</script>
</head>
HTML <noscript> Tag
The <noscript> tag is used to provide an alternate content for users who have disabled scripts in their browsers.

For example:
<head>
<script type="text/javascript">
document.write
("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript.<br /></noscript>

HTML <body> Tag

The <body> tag contains all the content visible in the HTML webpage. It can contain text, hyperlinks, pictures, tables, forms etc. In fact, all the page content is written inside the body element. That is why, the body element is one of the most important elements in HTML language.

Wednesday, 26 November 2014

Introduction to CSS

CSS is used to control the style and layout of multiple web pages. It defines how to style HTML elements. An HTML element can be displayed with different styles using CSS.

CSS stands for Cascading Style Sheets.

CSS language are normally saved as external .css file. External style sheets helps you to change the appearance and layout of al the webpages using a single file. Therefore, using a CSS file can save you a lot of work and design the webpage as you like.

CSS Syntax

A CSS declaration always ends in a semi-colon and the group is surrounded by curly brackets. A CSS rule consist of a selector and the declaration block:

For example:
h1 {color:blue;}
In this example, "h1" is the selector. The selector points out the HTML element you want to style.The selector is used to select a specific tag in which the style is to be applied on and edit the element according to our wish. CSS selectors are used to find or select the HTML element based on their id, classes, types, attributes, values of attributes etc.

Everything inside the curly bracket is called the declaration. The declaration block can contain more than one or more declarations separated by a comma. Each declaration contains a property name and values, which is separated by a comma. In this example, the property name is "color" and the value is "blue". It specifies the color of the h1 heading to be blue in color.

CSS Comments

Comments are used to explain the code or what that HTML element is used for. It is very useful for users to edit the source code later. Comments are ignored by the browser, so that they are not displayed in the web browser.

CSS comments starts with /* and ends with */. Comments are plain text written inside /* and */. Comments can also span multiple lines

For example:
/*This is a single line comment*/
h1 {color:blue;
/*This is a 
multiple line comment*/
}

CSS Style Sheets

CSS style sheets can be added in three ways:

  1. External Style Sheets
  2. Internal Style Sheets
  3. Inline Style Sheets
External Style Sheets: An external style sheets is used when the same style is used to more than one webpage. With an external style sheet, we can change the looks of the entire webpage by changing just one file. Each page must be linked to the style sheet using the tag. The tag goes inside the head section.

For example:
<head>
<link href="style.css" rel="stylesheet" type="text/css"></link>
</head>
An external CSS style sheet can be written in Notepad just like HTML, but should be saved with .css extension.

For example:
h1 {color:blue;}
p{color:red;}
Internal Style Sheets: An internal style sheet should be used when a single document should have a unique style. We can define internal style sheet in the head section of the HTML page,using the &ltstyle> tag.

For example:
<head>
<style>
h1 {color:blue;}
p{color:red;}
</style>
<head>
Inline Style Sheets: An inline style sheet is used when a single element should be given a unique style. Inline styles are given inside the tag itself as attributes. To use the inline style, we should use the style attribute in that particular tag. The style is possible to contain any CSS styles but that property is only restricted to that particular element only.

For example:
<div style="color: red;">
This is a paragraph.</div>

Saturday, 22 November 2014

HTML Know The Basics

HTML language have a pattern in which the content is edited. Everyone who codes in HTML language should follow the same principle provided by the HTML standards. HTML language consists of different sections in which each section is coded.

Here is a sample code written in HTML

<html>

<head>
Head of the document...
</head>

<body>
Body of the document...
</body>

</html>

HTML Versions

Since the beginning of the web, there have been many versions of HTML, each one of them better than the previous with more functions and efficiency.

  1. HTML - Released in 1991
  2. HTML+ - Released in 1993
  3. HTML 2.0 - Released in 1995
  4. HTML 3.2 - Released in 1997
  5. HTML 4.01 - Released in 1999
  6. XHTML 1.0 - Released in 2000
  7. HTML5 - Released in 2012

HTML Declaration

The Declaration is the first thing to be coded in your HTML page. It defined the document type of the HTML page that you are coding. It is also prompted to add the declaration to your HTML page, so that the browser can determine what type of document the webpage is.

The Declaration is not an HTML tag, it is just used to instruct the web browser about the version of HTML used to code the webpage.

in HTML 4.01, the declaration refers to DTD, because HTML 4.01 was based on SGML. The DTD is used to specify the rules for the markup language, so that the browser can render the contents correctly. In HTML5 it does not require a reference to a DTD because it is not based on SGML. Here are some of the common DOCTYPE Declaration of HTML

HTML5
<!DOCTYPE html>
HTML 4.01 Strict
"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

HTML <html> Tag

The <html> tag is used to describe the webpage. It is used to tell the browser that this is an HTML document.

The <html> tag is the root of an HTML document and is also the container for all other HTML elements except the declaration.

HTML <head> Tag

The <head> element is used to include the header files of the webpage. It is a container for all head elements.

The following elements can go inside the head section :

  • <title>
  • <style>
  • <base>
  • <link>
  • <meta>
  • <script>
  • <noscript>

HTML <body> tag

The <body> tag is used to define the document's body. It is used to describe the visible webpage contents coded using HTML language.

The <body> tag contains all the contents of an HTML document, such as text, hyperlinks, images, tables, forms etc.

HTML Comments

Comments are used to place details and information about HTML elements. comments are not displayed by the browser but is visible in the source code. Comments are used using the comment tag <!-- and -->. Note that an exclamation mark (!) is written in the starting but not in the ending.

For example:
<!--This is a comment-->