Saturday, November 27, 2010

Basic HTML Code

Explanation




Attribute: behavior

This sets the background color for marquee path.

It takes values SCROLL or SLIDE or ALTERNATE

Example Code:

<marquee bgcolor=orange width=200 height=20 direction=right behavior=alternate> Moving Text</marquee>


Result:

Moving Text





Attribute: scrollamount

This controls the amount of movement (in pixels) between the successive displays that give the impression of animation.

Example Code:

<marquee bgcolor=orange width=200 height=20 direction=right behavior=alternate scrollamount=5> Moving Text Tag </marquee>


Result with scrollamount as 5:

Moving Text Tag

Result with scrollamount as 50:

Moving Text Tag



Attribute: srolldelay

This controls the delay (in milliseconds) between the successive displays that give the impression of animation.

Example Code:

<marquee bgcolor=orange width=200 height=20 direction=right behavior=alternate scrolldelay=5> Scrolling Text Tag </marquee>


Result with scroll delay as 5:

Scrolling Text Tag

Result with scroll delay as 500:

Scrolling Text Tag



Moving Image

Similarly image can be moved. Instead of text in between marquee tags give an image. It will scroll/move

Example Code:


<marquee width=100 height=20> <img src="./test.jpg"> </marquee>

Result: Scrolling Images








blink: <blink> </blink>


If you want blinking text, use this tag.

The tag used is "blink"



Example Code:

<blink> blinking text tag</blink>




Result:

blinking text tag



[Note: This may not work on few browsers]


Table is most beautiful concept in html.

Now a days, most of the websites are created using table structure.

The concept of table is very simple, just rows and columns.

We will split the window in to so many number of rows and columns as required.





Table

This tag can not act alone. It needs "tr" and "td" tags with in it.

Example Code:


<table> </table>

As we know that table is a set of rows and columns, we introduce rows inside the table using
<tr> </tr>.
Also each row can have any number of columns. one to n..., so we introduce columns inside the rows using the tags <td> </td>



So putting things together we define a table with a row and column as follows



Code:


<table>

<tr>

<td>
This is first column

</td>

</tr>

</table>



Result:

The result for above tag will be as
This is first column
Table with border To make things much clear, we will put border to the table using the attribute "border". This attribute should be added in "table" tag. Example Code: <table border=1> <tr> <td> This is first column </td> <td> This is second column </td> </tr> </table> Result: The result for above tag will be as
This is first column This is second column
This is first column This is second column
Table with 2 row 2 col Now we will try to create a table with 2 row and 2 cols each Example Code: <table border=1> <tr> <td> This is 1st row 1st column </td> <td> This is 1st row 2nd column </td> </tr> <tr> <td> This is 2nd row 1st column </td> <td> This is 2nd row 2nd column </td> </tr> </table> Result: The result for above tag will be as
This is 1st row 1st column This is 1st row 2nd column
This is 2nd row 1st column This is 2nd row 2nd column



Table with color

We can add background color to the table using the attribute "bgcolor".

This attribute can be added in "table"/"tr"/"td" tag.
The color can be set on the whole to table or to rows and column



Example Code:


<table border=1 bgcolor="green">

<tr>


<td>

This is first column

</td>

<td bgcolor="yellow">

This is second column

</td>

</tr>

</table>




Result:

The result for above tag will be as
This is first column This is second column



Table with background image

No comments:

Post a Comment