HTML

HTML

Posted on

Comparison between HTML and XML

XML HTML
Describes data and focuses on what data is Displays data and focuses on how data look
Supports case- sensitivity Does not support case-sensitivity
Refers to a user-defined language ie user can define their own tags Refers to a pre-defined language ie user can use only the predefined tags
Mandatory to close each and every tag It is not mandatory to close each and every tag
Mandatory to enclose  attributes values in double quote It is not mandatory to enclose attributes values in double quotes

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Advertisements

Style Classes

Posted on Updated on

In Style Classses method, you can create styles in the form of style classes in external or embedded style sheets. To apply a style defined in a style class to an HTML element, you can assign the class attribute of the HTML element to the name of the style class.

There are two types of classes

1)      Universal style class

2)      Element specific class

 

<html>

<head>

<title>Style classes</title>

<style>

body{ background-color:#f0f8ff}

th.color {background-color:#800000}

.green{background-color:#008000}

</style>

</head>

<body>

<table border=”1″>

<caption><h2>Student Details</h2></caption>

<th class=”color”>Name</th>

<th class=”color”>Date of Birth</th>

<th class=”color”>Address</th>

<tr>

<td class=”green”>sumit Saxena</td>

<td class=”green”>15/3/1983</td>

<td class=”green”>Mumbai</td>

</tr>

<tr>

<td class=”green”>Amitabh Kumar</td>

<td class=”green”>22/02/1984</td>

<td class=”green”>chennai</td>

</tr>

<tr>

<td class=”green”>Rohit Jindal</td>

<td class=”green”>5/7/1983</td>

<td class=”green”>Delhi</td>

</tr>

</table>

</body>

</html>

1

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

HTML Table Example

Posted on Updated on

Table Examples
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body>
<table align=”center” border=”1″  style=”width: 80%”>
<tr>
<td align=”center” style=”width:250px” >
</td>
<td style=”width:250px”>
Namee</td>
<td style=”width:250px”>
<input id=”Text1″ type=”text” /></td>
</tr>
<tr>

<td style=”width:250px”>
Address</td>
<td style=”width:250px”>
<input id=”Text2″ type=”text” /></td>
<td>
</td>
</tr>
<tr>

<td style=”width:250px”>
</td>
<td align=”center” style=”width:250px”>
<input id=”Button2″ type=”button” value=”Save” /></td>
<td>
</td>
</tr>
</table>
</body>
</html>

Table Row Vertical Align
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table border=”1″ style=”height:200px”>
<tr valign=”middle”>
<th>Month</th>
<th>Savings</th>
</tr>
<tr valign=”bottom”>
<td>January</td>
<td>$100</td>
</tr>
</table>
</body>
</html>

Table Cell Align – Center

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table border=”1″ style=”width: 100%;”>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>

<tr>
<td style=”height:107px”>

</td>
<td align=”center” valign=”top” style=”height:107px”>
<input id=”Submit1″ type=”submit” value=”submit” />
</td>
<td style=”height:107px”>
</td>
</tr>
<tr>
<td> &nbsp;</td>
<td> &nbsp;</td>
<td> &nbsp;</td>
</tr>
</table>
</body>
</html>

Table Background Image

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table background=”http://www.tizag.com/pics/htmlT/background.jpg&#8221;
style=”width: 80%; height: 192px;”>
<tr>
<td>   </td>
<td>   </td>
<td>   </td>
</tr>
<tr>
<td>    </td>
<td>    </td>
<td>    </td>
</tr>
<tr>
<td>
</td>
<td align=”center”>
</td>
<td>
</td>
</tr>
</table>
</body>
</html>

Column Spanning in multiple Cells in Table

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body>

<table border=”1″ style=”width:75%;”>
<tr>
<td>               </td>
<td style=”width:250px”>
<input id=”Text2″ type=”text” /></td>
<td>
</td>
</tr>
<tr>
<td>                </td>
<td style=”width:250px”>
<input id=”Text1″ type=”text” /></td>
<td>
</td>
</tr>
<tr>
<td>                </td>
<td align=”center” colspan=”2″>
<input id=”Submit1″ type=”submit” value=”submit” /></td>
</tr>
</table>

</body>
</html>

HTML Example Body Color of a web page

Posted on

Body Color of a web page
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”silver” style=”font-family:arial;color:red;font-size:20px;” text=”Red”>
<p>
This is to test the properties of body
</p>
</body>
</html>