Sunday, January 13, 2019

Internal Javascripts

Internal Javascripts :   
The script code can be written directly into the HTML document. script code is placed in header of the document using script tag .

EXAMPLE: 

<html>

<head>

<title>Internal Script</title>

<script type="text/javascript">
function internal(){
alert("Internal Script");
}
</script>

</head>

<body>

<h2>Example for Internal script</h2>

<input type="button" 
onclick="internal();
"value="Click here" />

</body>

</html>

OUTPUT:-
sk.1

sk.2

External Javascripts

External Javascripts :         

If the functionality to be defined is used in various HTML documents then it's better to keep that functionality in a separate Javascript file and then include that file in your HTML documents. A Javascript file will have extension as .js and it will be included in HTML files using script tag.

EXAMPLE:

<html>

<head>

<title>External Script</title>

<script src="/html/External.js" 
type="text/javascript"/>

</script>

</head>

<body>
<h2>Example for External Script</h2>

<input type="button" 
onclick="External();
" value="Click here"  />

</body>

</html>

OUTPUT:-
sk.


HTML JAVASCRIPTS

HTML JAVASCRIPTS :   

A script is a small piece of program that can add interactivity to the website. For example, a script could generate a pop-up alert box message, or provide a dropdown menu. This script could be written using Javascript or VBScript , various small functions, called event handlers can be written using any of the scripting language and then you can trigger those functions using HTML attributes.
The <script> tag is used to define a clientside script, such as a JavaScript.

USING IFRAME AS TARGET AS LINK

USING IFRAME AS TARGET AS LINK :

An iframe can be used as the target frame for a link ,the target attribute of the link must refer to the name attribute of the iframe.

EXAMPLE:-

<html>

<body>

<iframe width="100%" height="300px"
src="d_iframe.htm" name="iframe_ex">
</iframe>

<a href="http://www.google.com
/demo12" target="iframe_ex">
IFRAME-TARGET</a>

<p>When the target of a link matches 
the name of an iframe, the link will 
open in the iframe.</p>

</body>

</html>


OUTPUT:-
sk.1
sk.2

IFRAME EDITING THE BORDER

IFRAME EDITING THE BORDER :

The border of the Iframe can be edited and changed according to the needs , By default, an iframe has a black border around it . The Iframe border size , color and style can be changed with css .

EXAMPLE:-

<html>

<body>

<iframe src="edit_exiframe.htm" 
style="border:4px outset red">
</iframe>

</body>

</html>

OUTPUT:-
sk.

IFRAME HEIGHT & WIDTH

IFRAME HEIGHT & WIDTH :  

Use the height and width attributes to specify the size of the IFRAMES ,the attribute values are specified in pixels by default, but they can also be in percent.

EXAMPLE:-


<html>

<body>

<iframe src="example_iframe.htm" 
width="200" height="200"></iframe>

</body>

</html>

OUTPUT:-   
sk.

Saturday, January 12, 2019

HTML IFRAMES

HTML IFRAMES :        

An IFrame (Inline Frame) is an HTML document embedded inside another HTML document on a website , which is displaying a web page within a web page. The IFrame HTML element is often used to insert content from another source ,it can be configured with its own scrollbar independent of the surrounding page's scrollbar.

Syntax :-    <iframe src="URL"></iframe>


      

LAYOUT USING TABLES

LAYOUT USING TABLES :   

The layout using Tables are the simplest and most popular way of creating layouts . These tables are arranged in columns and rows, so it can utilized in many ways according to the need .

EXAMPLE:-

<html>
<head>
<title>Layout using Tables</title>
</head>
<body>



<table width="100%" border="0">
<tr>
<td colspan="2"bgcolor="steelblue">
<center>  
<h1>BIG CATS</h1>
</center>
</td>
</tr>


<tr valign="top">

<td bgcolor="#48D1CC" width="50">
<b>Main Menu</b><br />
Tiger<br />
Lion<br />
Cheetah
</td>

<td bgcolor="#eee" width="100" 
height="200">
The tiger (Panthera tigris) 
is the largest cat species
</td>

</tr>


<tr>
<td colspan="2"bgcolor="steelblue">
<center>
Copyright  2019
</center>
</td>
</tr>

</table>
</body>
</html>

OUTPUT:-  
sk.


Friday, January 11, 2019

LAYOUT USING div ELEMENT :

LAYOUT USING div ELEMENT : 

<span style="font-size: x-large;">The div element is used in this layout it is a block level element used for grouping HTML elements.</span><span style="font-size: x-large;"><br /></span><span style="font-size: x-large;"><b><u>EXAMPLE</u></b> :</span><br />
<html>

<head>
<style>
#header {
    background-color:steelblue;
    color:white;
    text-align:center;
    padding:5px;
}
#nav {
    line-height:30px;
    background-color:#48D1CC;
    color:white;
    height:350px;
    width:110px;
    float:left;
    padding:5px;       
}
#section {
    width:350px;
    float:left;
    padding:10px;    
}
#footer {
    background-color:steelblue;
    color:white;
    clear:both;
    text-align:center;
   padding:5px;    
}
</style>
</head>

<body>

<div id="header">
<h1>BIG CATS</h1>
</div>

<div id="nav">
Tiger<br>
Lion<br>
Cheetah<br>
</div>

<div id="section">

<h2>Tiger</h2>

<p>
The tiger (Panthera tigris) 
is the largest cat species, 
reaching a total body length 
of up to 3.38 m (11.1 ft) over
curves and weighing up to 388.7
kg (857 lb) in the wild.

<p>
The tiger populations 
occurring in small pockets 
isolated from each other, of 
which about 2,000 exist on the
Indian subcontinent.
</p>

</div>

<div id="footer">
Copyright  2015
</div>

</body>
</html>

OUTPUT:-  
sk.

HTML LAYOUT

HTML LAYOUT :-   

A webpage layout gives a structure to the website , layout is very important to give better look to the website .

WEB SITE LAYOUT :


Header : Header Defines a header for a document or a section .
Navigation : Navigation Defines a container for navigation links .
Content : Defines a section of the page with document or article and other information .
Sidebar : Defines content aside from the main content of the page .
Footer : Defines a footer for a document or a section .


Transition

Transition:-  

Transitions allows you to change property values smoothly from one value to another, over a given duration. To create a transition effect, you must specify two things, the CSS property you want to add an effect to and the duration of the effect.If the duration part is not specified, the transition will have no effect, because the default value is 0.

EXAMPLE:-

<html>
<head>
<style> 

#a {

    width: 100px;
    height: 100px;
    background: steelblue;
    -webkit-transition: width 2s; 
    transition: width 2s;

}

#a:hover {
    width: 400px;
}





#b {

width: 100px;
height: 100px;
background: turquoise;
-webkit-transition: width 2s, 
height 2s, -webkit-transform 2s; 
transition: width 2s, height 2s, 
transform 2s;

}

#b:hover {

width: 300px;
height: 300px;
-webkit-transform: rotate(180deg); 
transform: rotate(180deg);

}


</style>
</head>

<body>

<h3> Transition  </h3>

<div id ="a">
</div>

<p>Hover over the div element above, 
to see the transition effect.</p>

<div id ="b">
</div>

</body>
</html>

OUTPUT:-

ANIMATION

ANIMATION:-   

An animation lets an element gradually change from one style to another, we can change as many CSS properties and many times as we want.
  • To use CSS3 animation, we must first specify some keyframes for the animation.Keyframes hold what styles the element will have at certain times.
  • When we specify CSS styles inside the @keyframes rule, the animation will gradually change from the current style to the new style at certain times.
  • To get an animation to work, we must bind the animation to an element.

EXAMPLE:-

<html>
<head>
<style>
 
div {
width: 200px;
height: 150px;
background-color: steelblue;
position: relative;
-webkit-animation-name: example; 
-webkit-animation-duration: 4s; 
-webkit-animation-iteration-count:3; 
animation-name: example;
animation-duration: 4s;
animation-iteration-count: 3;
}


@-webkit-keyframes example {

0%   {background-color:steelblue; 
left:0px; top:0px;}
25%  {background-color:yellow; 
left:200px; top:0px;}
50%  {background-color:blue; 
left:200px; top:200px;}
75%  {background-color:green; 
left:0px; top:200px;}
100% {background-color:orange; 
left:0px; top:0px;}

}


</style>
</head>
<body>

<p><h3>ANIMATION</h3> </p>

<div></div>

</body>
</html>

OUTPUT:-

FORMS

FORMS:-  

A form on a web page allows a user to enter data that is sent to a server for processing.

EXAMPLE:-

<html>

<head>

<style> 

<!-- This is for Padded field -->

input[type=text] {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    box-sizing: border-box;
}

<!-- This is for Bordered Field -->

input[type=text1] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border: 4px solid steelblue;
border-radius: 4px;
}


<!-- This is for image Field -->


input[type=text2] {
width: 100%;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
font-size: 16px;
background-color: white;
background-image: url
('sicon.png');
background-position: 10px 10px; 
background-repeat: no-repeat;
padding: 12px 20px 12px 40px;
}


<!-- This is for Animated Field -->


input[type=text3] {
    
width: 130px;
box-sizing: border-box;
border: 3px solid steelblue;
border-radius: 4px;
font-size: 16px;
background-color: white;
background-image: url('sicon.png');
background-position: 10px 10px; 
background-repeat: no-repeat;
padding: 12px 20px 12px 40px;
-webkit-transition: width 0.4s 
ease-in-out;
transition: width 0.4s ease-in-out;
}

input[type=text3]:focus {
    width: 60%;
}

</style>

</head>

<body>

<h3>Padded Text fields:</h3>

<form>

<label for="fname">First Name
</label>
<input type="text" id="fname" 
name="fname">
<label for="fname">Last Name</label>
<input type="text" id="lname" 
name="lname">

</form>




<h3> Bordered Text Fields</h3>



<form> 

<label for="fname">First Name</label>
<input type="text1" id="fname" 
name="fname">
<label for="lname">Last Name</label>
<input type="text1" id="lname" 
name="lname">

</form>



<h3>Text Fields with icon/image </h3>

<form>

<input type="text2" name="search" 
placeholder="Search..">

</form>




<h3> Animated Text Field </h3>


<form>

  <input type="text3" name="search" 
placeholder="Search..">

</form>






</body>
</html>

OUTPUT:
sk.

DROPDOWN

DROPDOWN:-

A drop-down menu is a graphical control element, similar to a list box, that allows the user to choose one value from a list. When a drop-down list is inactive, it displays a single value. When activated, it displays (drops down) a list of values, from which the user may select one.

EXAMPLE:-

<html>
<head>
<style>

.dropdown1 {
    position: relative;
    display: inline-block;
}

.dropdown1-content {
    display: none;
    position: absolute;
    background-color: lightgrey;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px 
    rgba(0,0,0,0.2);
    padding: 12px 16px;
}

.dropdown1:hover .dropdown1-content {
    display: block;
}





.dropbtn {
    background-color: steelblue;
    color: white;
    padding: 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}



.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px 
    rgba(0,0,0,0.2);
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover 
{background-color: #f1f1f1}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: turquoise;
}
</style>
</head>
<body>

<h2>Dropdown Menu</h2>
<p>Move the mouse over the button to 
open the dropdown menu.</p>

<div class="dropdown">

<button class="dropbtn">Dropdown
</button>

<div class="dropdown-content">

<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>

</div>
</div>

  





<h2>Hoverable Dropdown</h2>
<p>Move the mouse over the text 
below to open the dropdown 
content.</p>

<div class="dropdown1">
  <span>Mouse over me</span>
  <div class="dropdown1-content">
    <p>Hoverable Dropdown</p>
  </div>
  </div>



</body>
</html>

OUTPUT:-
sk.1
sk.2

Horizontal Navigation Bar

Horizontal Navigation Bar:-

In the horizontal navigation bar all the content will be in horizontal format.

EXAMPLE:-

<html>
<head>
<style>
ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #333;
}

li {
    float: left;
}

li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

li a:hover:not(.active) {
    background-color: turquoise;
}

.active {
    background-color: steelblue;
}
</style>
</head>
<body>
<h3> Horizontal Navigation Bar </h3>

<p>In this example, Active class is 
in a Steelblue background color and 
a white text.</p>

<ul>

<li><a class="active" href="#home">
Home</a></li>
<li><a href="#news">Content</a>
</li>
<li><a href="#contact">Contact</a>
</li>
<li><a href="#about">About</a>
</li>

</ul>



</body>
</html>

OUTPUT:-
sk.

Fixed Vertical Navigation Bar

Fixed Vertical Navigation Bar:-      

In fixed Vertical Nave Bar, the nav bar will be fixed in the same position even if the content of the page is scrolled down.


EXAMPLE:-

<html>

<head>

<style>

body {
    margin: 0;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 26%;
    background-color: #f1f1f1;
    position: fixed;
    height: 100%;
    overflow: auto;
}

li a {
    display: block;
    color: #000;
    padding: 8px 0 8px 16px;
    text-decoration: none;
}

li a.active {
    background-color: steelblue;
    color: white;
}

li a:hover:not(.active) {
    background-color: turquoise;
    color: white;
}

</style>

</head>

<body>

<ul>
<li><a class="active" href="#home">
Home</a></li>
<li><a href="#news">News</a>
</li>
<li><a href="#contact">Contact</a>
</li>
<li><a href="#about">About</a>
</li>
</ul>

<div style="margin-left:26%;
padding:2px 16px;height:1000px;">

<h2>Fixed Side Nav Bar</h2>

<h3>Try to scroll this area, and 
see how the sidenav sticks 
to the page</h3>

<p>Notice that this div element 
has a left margin of 26%. This 
is because the side navigation 
is set to 26% width. If you 
remove the margin, the sidenav 
will overlay/sit on top of 
this div.</p>

  
<p>Also notice that we have set 
overflow:auto to sidenav. This 
will add a scrollbar when the 
sidenav is too long (for 
example if it has over 50 links
inside of it).</p>

  <p>Text 1</p>
  <p>Text 2</p>
  <p>Text 3</p>
  <p>Text 4</p>
  <p>Text 5</p>
  <p>Text 6</p>
  <p>Text 7</p>
  <p>Text 8</p>
  <p>Text 9</p>

</div>

</body>
</html>

OUTPUT:-
sk.


NAVIGATION BAR

NAVIGATION BAR:           

A navigation bar is a section of a graphical user interface intended to aid visitors in accessing information. Navigation bars are implemented in file browsers, web browsers and as a design element of some web sites.

In the vertical navigation bar all the content will be in vertical format.

EXAMPLE:-   


<html>

<head>

<style>

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 200px;
    background-color: ;
}

li a {
    display: block;
    color: #000;
    padding: 8px 0 8px 16px;
    text-decoration: none;
}

li a.active {
    background-color: steelblue;
    color: white;
}

li a:hover:not(.active) {
    background-color: turquoise;
    color: white;
}

</style>

</head>

<body>

<h2>Vertical Navigation Bar</h2>

<p>In this example, Active class is 
in a Steelblue background color and 
a white text.</p>

<ul>

<li><a class="active" href="#home">
Home</a></li>
<li><a href="#Content">Content</a>
</li>
<li><a href="#contact">Contact</a>
</li>
<li><a href="#about">About</a>
</li>

</ul>

</body>
</html>

OUTPUT:
sk.

Thursday, January 10, 2019

CSS BOX

CSS BOX :           


This creates a box a around an HTML element , CSS border property defines a visible border around an element and padding property defines a padding space inside the border , margin property defines a margin space outside the border .

EXAMPLE:-

<html>

<head>
<style>

p {
    border:5px solid steelblue;
    padding:10px;
    margin:30px;
}

div {
    width: 320px;
    padding: 10px;
    border: 5px solid Turquoise;
    margin: 30px;
}

</style>
</head>
<body>

<p>CSS BOX EXAMPLE</p>

<div>

<p> This a Box </p>

</div>

</body>
</html>
"""""""""""""""""""""""'''''""""""""""""""""""
OUTPUT:-      
sk.
"""""""""""""""""""""""""""""""""""""""""""



HTML CSS

HTML CSS :    

CSS stands for Cascading Style Sheets , it defines how HTML elements are to be displayed.

It can be added to HTML elements in 3 ways:     

1.Inline - using a style attribute in HTML elements.
2.Internal - using a <style> element in the HTML <head> section.
3.External - using one or more external CSS files.

SYNTAX:-  

element { property:value ; property:value }


GETTING STARTED

GETTING STARTED:-   

   


HTML files are just simple text files, so to start writing in HTML, you need a simple text editor ,for learning HTML a simple text editor like Notepad (PC) or TextEdit (Mac) will be easy . HTML can be edited by using a professional HTML editor like Adobe Dreamweaver , Microsoft Expression Web,CoffeeCup HTML Editor .

To create a simple Webpage with notepad :    

 => Open Notepad (PC) or TextEdit (Mac)

Write some HTML into Text Editor :   

Following is an example of a simple HTML document with Heading and Paragraph :-

 EXAMPLE:-
---------------------------------------------------------
<html>

<body>

  <h1>This is Heading</h1>

  <p> This is paragraph</p>

</body>

</html> 

---------------------------------------------------------

Save the HTML page :-

  • The finished page should be saved in .Html extension .
  • UTF-8 is the preferred encoding for HTML files .

To view the HTML page :-

Open the saved HTML file in your browser. The page will look like this:-

================================   

This is Heading

This is paragraph
================================

Tuesday, January 8, 2019

Html versions.

HTML VERSIONS:-     
sk.

    VERSIONS :- YEAR


  • HTML.        :- 1991
  • HTML 2.0   :- 1995
  • HTML 3.2   :- 1997
  • HTML 4.01 :- 1999
  • XHTML       :- 2000
  • HTML 5      :-  2012




HTML.

HTML:-      
sk.

HTML stands for Hyper Text Markup Language it was created by Berners-Lee in late 1991 , which is the most widely used language on Web to develop web pages.

Web browsers can read HTML files and compose them into visible or audible web pages. Browsers do not display the HTML tags and scripts, but use them to interpret the content of the page. HTML describes the structure of a website semantically along with cues for presentation, making it a markup language, rather than a programming language .


Monday, January 7, 2019

A table with cell spacing

A table with cell spacing:-     


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  padding: 5px;
}
table {
  border-spacing: 15px;
}
</style>
</head>
<body>

<h2>Border Spacing</h2>
<p>Border spacing specifies the space between the cells.</p>

<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Akash</td>
    <td>Jaiswal</td>
    <td>20</td>
  </tr>
  <tr>
    <td>Ansh</td>
    <td>Rana</td>
    <td>24</td>
  </tr>
  <tr>
    <td>Jordan</td>
    <td>Singh</td>
    <td>28</td>
  </tr>
</table>

<p>Try to change the border-spacing to 5px.</p>

</body>
</html>

OUTPUT:-   



Table cells that span more than one row

Table cells that span more than one row:-     


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 4px;
  text-align: left;   
}
</style>
</head>
<body>

<h2>Cell that spans two rows</h2>
<p>To make a cell span more than one row, use the rowspan attribute.</p>

<table style="width:100%">
  <tr>
    <th>Name:</th>
      <td>Akash Jaiswal</td>
  </tr>
  <tr>
    <th rowspan="2">Telephone:</th>
    <td>987 8866 528</td>
  </tr>
  <tr>
    <td>987 8866 528</td>
  </tr>
</table>

</body>
</html>

OUTPUT:- 




Table cells that span more than one column

Table cells that span more than one column:-     


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 4px;
  text-align: left;   
}
</style>
</head>
<body>

<h2>Cell that spans two columns</h2>
<p>To make a cell span more than one column, use the colspan attribute.</p>

<table style="width:100%">
  <tr>
    <th>Name</th>
      <th colspan="2">Telephone</th>
  </tr>
  <tr>
    <td>Akash Jaiswal</td>
    <td>987 8866 528</td>
    <td>987 8866 528</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-     




A table with a caption

A table with a caption:-     


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 5px;
  text-align: left;
}
</style>
</head>
<body>

<h2>Table Caption</h2>
<p>To add a caption to a table, use the caption tag.</p>

<table style="width:100%">
  <caption>Car Price</caption>
  <tr>
      <tr>
    <th>Car</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Maruti</td>
    <td>$860</td>
  </tr>
  <tr>
    <td>Fortuner</td>
    <td>$1000</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-     




Horizontal/Vertical table headings

Horizontal/Vertical table headings:-   


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 5px;
  text-align: left;
}
</style>
</head>
<body>

<h2>Horizontal Headings:</h2>

<table style="width:100%">
  <tr>
    <th>Name</th>
    <th>Telephone</th>
    <th>Telephone</th>
  </tr>
  <tr>
    <td>Akash Jaiswal</td>
    <td>987 8866 528</td>
    <td>987 8866 528</td>
  </tr>
</table>

<h2>Vertical Headings:</h2>

<table style="width:100%">
  <tr>
    <th>Name:</th>
    <td>Akash Jaiswal</td>
  </tr>
  <tr>
    <th>Telephone:</th>
    <td>987 8866 528</td>
  </tr>
  <tr>
    <th>Telephone:</th>
    <td>987 8866 528</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-        



Saturday, January 5, 2019

A table with left-aligned headings

A table with left-aligned headings:-   

<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 5px;
}
th {
  text-align: left;
}
</style>
</head>
<body>

<h2>Left-align Headings</h2>
<p>To left-align the table headings, use the CSS text-align property.</p>
<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Akash</td>
    <td>Jaiswal</td>
    <td>20</td>
  </tr>
  <tr>
   <td>Ansh</td>
    <td>Rana</td>
    <td>24</td>
  </tr>
  <tr>
    <td>Jordan</td>
    <td>Singh</td>
    <td>28</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-


  • To left-align the table headings, use the CSS text-align property.





A table with headings

A table with headings:- 


<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 5px;
}
</style>
</head>
<body>

<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
   <td>AKASH</td>
    <td>Jaiswal</td>
    <td>20</td>
  </tr>
  <tr>
    <td>ANSH</td>
    <td>Rana</td>
    <td>24</td>
  </tr>
  <tr>
    <td>JORDAN</td>
    <td>Sharma</td>
    <td>28</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-

Wednesday, January 2, 2019

A table with cell padding

A table with cell padding:- 


<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 15px;
}
</style>
</head>
<body>

<h2>Cellpadding</h2>
<p>Cell padding specifies the space between the cell content and its borders.</p>

<table style="width:100%">
  <tr>
    <th>Firstname</th>
      <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Akash</td>
    <td>Jaiswal</td>
    <td>20</td>
  </tr>
  <tr>
      <td>Ansh</td>
    <td>Rana</td>
    <td>25</td>
  </tr>
  <tr>
    <td>Jordan</td>
    <td>Singh</td>
    <td>30</td>
  </tr>
</table>

<p>Try to change the padding to 5px.</p>

</body>
</html>

OUTPUT:- 

sk.


A table with collapsed borders

A table with collapsed borders:- 


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  border-collapse: collapse;
}
</style>
</head>
<body>

<h2>Collapsed Borders</h2>
<p>If you want the borders to collapse into one border, add the CSS border-collapse property.</p>

<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
   <td>Akash</td>
    <td>Jaiswal</td>
    <td>20</td>
  </tr>
  <tr>
    <td>Ansh</td>
    <td>Rana</td>
    <td>23</td>
  </tr>
  <tr>
    <td>Jordan</td>
    <td>Singh</td>
    <td>30</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-  

sk.


Tuesday, January 1, 2019

A table with borders

A table with borders:-   


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
}
</style>
</head>
<body>

<h2>Bordered Table</h2>
<p>Use the CSS border property to add a border to the table.</p>

<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
      <td>Akash</td>
    <td>Jaiswal</td>
    <td>23</td>
  </tr>
  <tr>
    <td>Ansh</td>
    <td>Singh</td>
    <td>25</td>
  </tr>
  <tr>
      <td>Joshif</td>
    <td>Sharma</td>
    <td>30</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-    

sk.

Basic HTML tables

Basic HTML tables:-   


<html>
<body>

<h2>HTML Tables</h2>

<p>HTML tables start with a table tag.</p>
<p>Table rows start with a tr tag.</p>
<p>Table data start with a td tag.</p>

<hr>
<h2>1 Column:</h2>

<table>
  <tr>
    <td>100</td>
  </tr>
</table>

<hr>
<h2>1 Row and 3 Columns:</h2>
<table>
  <tr>
    <td>100</td>
    <td>200</td>
    <td>300</td>
  </tr>
</table>

<hr>
<h2>3 Rows and 3 Columns:</h2>
<table>
  <tr>
    <td>100</td>
    <td>200</td>
    <td>300</td>
  </tr>
  <tr>
    <td>400</td>
    <td>500</td>
    <td>600</td>
  </tr>
  <tr>
    <td>700</td>
    <td>800</td>
    <td>900</td>
  </tr>
</table>

<hr>

</body>
</html>

OUTPUT:-

sk.




HTML Image Tags

HTML Image Tags Description:-    

sk.


  • <img> :- Defines an image.
  • <map> :- Defines an image-map.
  • <area> :- Defines a clickable area inside an image-map.
  • <picture> :- Defines a container for multiple image resources.



A floating image

A floating image:- 


<html>
<body>

<h2>Floating Images</h2>
<p><strong>Float the image to the right:</strong></p>

<p>
<img src="sad.gif" alt="Sad face" style="float:right;width:45px;height:45px;">
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
</p>

<p><strong>Float the image to the left:</strong></p>
<p>
<img src="sad.gif" alt="Sad face" style="float:left;width:45px;height:45px;">
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
</p>

</body>
</html>

OUTPUT:-    


  • Use the CSS float property to let the image float to the right or to the left of a text.

An image map with clickable regions

An image map with clickable regions:- 


<html>
<body>

<h2>Image Maps</h2>
<p>Click on the sun or on one of the planets to watch it closer:</p>

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

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>

</body>
</html>

OUTPUT:-      


  • The <map> tag defines an image-map. An image-map is an image with clickable areas.
  • The name attribute of the <map> tag is associated with the <img>'s usemap attribute and creates a relationship between the image and the map.
  • The <map> element contains a number of <area> tags, that define the clickable areas in the image-map.

A moving image

A moving image:-   


<html>
<body>

<h2>Animated Images</h2>
<p>The GIF standard allows moving images.</p>

<img src="program.gif" alt="Computer" style="width:38px;height:38px;">

</body>
</html>

OUTPUT:-


Using an image as a link

Using an image as a link:- 


<html>
<body>

<h2>Image as a Link</h2>
<p>The image is a link. You can click on it.</p>

<a href="default.asp">
  <img src="angel.gif" alt="HTML working" style="width:38px;height:38px;border:0;">
</a>

<p>Add "border:0;" to prevent IE9 (and earlier) from displaying a border around the image.</p>

</body>
</html>

OUTPUT:-


  • To use an image as a link, put the <img> tag inside the <a> tag.

An image on another server

An image on another server:- 


<html>
<body>

<h2>Images on Another Server</h2>

<img src="https://www.Tecko_hub.com/images/Tecko_hub.jpg" alt="Tecko_hub.com" style="width:104px;height:142px;">

</body>
</html>

OUTPUT:-   


  • Some web sites store their images on image servers.
  • you can access images from any web address in the world.

An image with a broken link

An image with a broken link:- 


<html>
<body>

<p>If a browser cannot find an image, it will display the alternate text:</p>

<img src="wrongname.gif" alt="car Icon" style="width:150px;height:150px;">

</body>
</html>

OUTPUT:-




An image in another folder

An image in another folder:- 


<html>
<body>

<h2>Images in Another Folder</h2>
<p>It is common to store images in a sub-folder. You must then include the folder name in the src attribute:</p>

<img src="/images/car.gif" alt="car Icon" style="width:150px;height:150px;">

</body>
</html>

OUTPUT:-   


  • If not specified, the browser expects to find the image in the same folder as the web page.
  • It is common to store images in a sub-folder. You must then include the folder name in the src attribute.

Internal Javascripts

Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...