Showing posts with label HTML. Show all posts
CSS comments
CSS comments are just like the comments we use in programming language.In programming languages, we use comment line for documentation purpose or instead of deleting some lines.
Sample code to illustrate comment lines:
<html>
<head>
<title>Sample</title>
<body>
<table border = " 1 " >
<tr>
<th>Date</th>/* It represents heading*/
<th>Day</th>
</tr>
<tr>
<td>1/1/2014</td>/*First cell of the table*/
<td>Wednesday</td>/*Second cell of the table*/
</tr>
<tr>
<td>2/1/2014</td>
<td>Thursday</td>
</tr>
<tr>
<td>3/1/2014</td>
<td>Friday</td>
</tr>
<tr>
<td>4/1/2014</td>
<td>Saturday</td>
</tr>
<tr>
<td>5/1/2014</td>
<td>Sunday</td>
</tr>
</tr>
</table>
</body>
</html>
Sample code to illustrate comment lines:
<html>
<head>
<title>Sample</title>
<body>
<table border = " 1 " >
<tr>
<th>Date</th>/* It represents heading*/
<th>Day</th>
</tr>
<tr>
<td>1/1/2014</td>/*First cell of the table*/
<td>Wednesday</td>/*Second cell of the table*/
</tr>
<tr>
<td>2/1/2014</td>
<td>Thursday</td>
</tr>
<tr>
<td>3/1/2014</td>
<td>Friday</td>
</tr>
<tr>
<td>4/1/2014</td>
<td>Saturday</td>
</tr>
<tr>
<td>5/1/2014</td>
<td>Sunday</td>
</tr>
</tr>
</table>
</body>
</html>
HTML
HTML tables:
In real time applications,user may want to prepare applicant details,Employee details, Student report card, and so on.These application would be effective,if they are in a tabular format.If these applications are to be presented in a web page,it can be done with HTML.
HTML provides the choice for the user to create tables.To create a table in HTML, <table> tag is used.Usually,application such as microsoft word, staroffice writer will display the details of first row as bold,when the data is in presented in a tabular format.
Similarly,browsers make the text which is present between the tag <th> as bold.Hence,in HTML we may use the tag for heading purpose.A table is divided into rows by <tr> tag and each row is divided into cells by <td> tags.
Example:
<th>HEADING</th>
<tr>FIRST ROW</tr>
<td>FIRST CELL</td>
Sample code to create a table in web page:
<html>
<head>
<title>Sample</title>
<body>
<table border = " 1 " >
<tr>
<th>Date</th>
<th>Day</th>
</tr>
<tr>
<td>1/1/2014</td>
<td>Wednesday</td>
</tr>
<tr>
<td>2/1/2014</td>
<td>Thursday</td>
</tr>
<tr>
<td>3/1/2014</td>
<td>Friday</td>
</tr>
<tr>
<td>4/1/2014</td>
<td>Saturday</td>
</tr>
<tr>
<td>5/1/2014</td>
<td>Sunday</td>
</tr>
</tr>
</table>
</body>
</html>
In real time applications,user may want to prepare applicant details,Employee details, Student report card, and so on.These application would be effective,if they are in a tabular format.If these applications are to be presented in a web page,it can be done with HTML.
HTML provides the choice for the user to create tables.To create a table in HTML, <table> tag is used.Usually,application such as microsoft word, staroffice writer will display the details of first row as bold,when the data is in presented in a tabular format.
Similarly,browsers make the text which is present between the tag <th> as bold.Hence,in HTML we may use the tag for heading purpose.A table is divided into rows by <tr> tag and each row is divided into cells by <td> tags.
Example:
<th>HEADING</th>
<tr>FIRST ROW</tr>
<td>FIRST CELL</td>
Sample code to create a table in web page:
<html>
<head>
<title>Sample</title>
<body>
<table border = " 1 " >
<tr>
<th>Date</th>
<th>Day</th>
</tr>
<tr>
<td>1/1/2014</td>
<td>Wednesday</td>
</tr>
<tr>
<td>2/1/2014</td>
<td>Thursday</td>
</tr>
<tr>
<td>3/1/2014</td>
<td>Friday</td>
</tr>
<tr>
<td>4/1/2014</td>
<td>Saturday</td>
</tr>
<tr>
<td>5/1/2014</td>
<td>Sunday</td>
</tr>
</tr>
</table>
</body>
</html>
Sample output:
HTML
Coding can be made effective with HTML, but designing with HTML is little difficult,since you will have to design only with your code.Alternative way of designing is to go with "CSS".(i.e) Cascading style sheet.
Using this we can design a web page more effective and attractive than the one made with HTML.
In this session,we can see about the basic inline and embedded styles and formatting with CSS.
Inline styles:
Using style sheet, we can code or design as follows:
<style>
h1{color:green}
</style>
To make a inline style,provide the attributes in a single tag.
<H1 style=textsize:14>
The above formatting is called inline style.An embedded style can be made by typing some property and values inside the heading tags
Sample code for embedded style:
<style>
H1
{
fontcolor:blue;
}
</style>
Fonts:
In HTML, we can specify a font type and size as follows:
<font face="arial,times new roman">ABC</font>
The same can be done with CSS as follows:
Font face:arial,Timesnew roman;
Sample web page using above concepts:
<html>
<head>
<title>New webpage</title>
<style>
H1
{
fontsize:14;
fontytype:arial,time new roman;
}
</style>
<body>
<font color="blue">The text is in blue</font>
</body>
</html>
Using this we can design a web page more effective and attractive than the one made with HTML.
In this session,we can see about the basic inline and embedded styles and formatting with CSS.
Inline styles:
Using style sheet, we can code or design as follows:
<style>
h1{color:green}
</style>
To make a inline style,provide the attributes in a single tag.
<H1 style=textsize:14>
The above formatting is called inline style.An embedded style can be made by typing some property and values inside the heading tags
Sample code for embedded style:
<style>
H1
{
fontcolor:blue;
}
</style>
Fonts:
In HTML, we can specify a font type and size as follows:
<font face="arial,times new roman">ABC</font>
The same can be done with CSS as follows:
Font face:arial,Timesnew roman;
Sample web page using above concepts:
<html>
<head>
<title>New webpage</title>
<style>
H1
{
fontsize:14;
fontytype:arial,time new roman;
}
</style>
<body>
<font color="blue">The text is in blue</font>
</body>
</html>
