he <style> tag | ||||||||||||||||||||||||
The <style> tag defines a style in a document. | ||||||||||||||||||||||||
The style element goes in the head section. If you want to include a style sheet in your page, you should define the style sheet externally, and link to it using <link>. Using this tag you can initialize the text properties as shown in the example. In the example color for the header tag is defined initially in the header part of the file using the <style> tag. | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
In the above example, h3 is a tag which will be displayed in red color which has been mentioned in the style tag. Just like h3 tag there is a tag i.e., h4 which will be displayed in the blue color which has been mentioned in the style sheet. | ||||||||||||||||||||||||
Attributes | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
Just write/copy this example on any text editor new file and save the file and open in the browser and see how it looks. | ||||||||||||||||||||||||
The <div> tag | ||||||||||||||||||||||||
The <div>tag defines a division/section in a document. Use the <div> tag to group block-elements to format them with styles. This tag is used below the <body> tag. | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
Attributes | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
Now lets have an example of both the tag. | ||||||||||||||||||||||||
Just write/copy this example on any text editor new file and save the file and open in the browser and see how it looks. | ||||||||||||||||||||||||
Example: | ||||||||||||||||||||||||
<html> <head> <style type=”text/css”> h1 {color: red} h3 {color: blue} </style> <title>style tag</title> </head> <body> Use of STYLE tag <h1>This is header H1 text </h1> <h3>This is header H3 text </h3> Use of DIV tag <div style=”color:#FF0000;”> This is a header in a div section <br>This is a paragraph in a div section </div><br> </body> </html> |
||||||||||||||||||||||||
Page in browser will Look Like: | ||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||
In the above example we have seen the use of <style> and <div> tags. the both the headers h1 & h3 are displayed in the Red and Blue color because their color has been defined in the style tags. Then we saw the use of <div> tag, so the text defined in the <div> tag in displayed in the color defined inside the <div> tag. | ||||||||||||||||||||||||
Click here! to see the Animation of how to create the above web page. | ||||||||||||||||||||||||
Marquee Text with <marquee> Tags | ||||||||||||||||||||||||
This tag is used to to get a moving text. As on the television you see the moving news headlines. You can do this by using the <marquee> tag. | ||||||||||||||||||||||||
Format: | ||||||||||||||||||||||||
<marquee> Write the text to be scrolled </marquee> | ||||||||||||||||||||||||
Example: | ||||||||||||||||||||||||
<marquee> Write the text to be scrolled </marquee> | ||||||||||||||||||||||||
Attributes | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
Behavior attribute | ||||||||||||||||||||||||
alternet: for this value the text bounces across the scroll region. | ||||||||||||||||||||||||
slide: for this value the text slides into position. | ||||||||||||||||||||||||
if you do not defines the behavior attribute then the text keeps scrolling continues manner according to the direction. BLINKING TEXT with <blink>Tag | ||||||||||||||||||||||||
This blinking text is the text which blinks like a bulb with on/off system. This blinking of text can be achieved in the HTML using the <blink> Tag. | ||||||||||||||||||||||||
Format : | ||||||||||||||||||||||||
<blink> write the text to blink </blink> | ||||||||||||||||||||||||
Example: | ||||||||||||||||||||||||
<blink> This is the blinking text. </blink> so now lets do some practical. | ||||||||||||||||||||||||
Just write/copy this example on any text editor new file and save the file and open in the browser and see how it looks. | ||||||||||||||||||||||||
Example: | ||||||||||||||||||||||||
<html> <head> <title>Marquee & Blink </title> </head> <body> <b>Marquee text with <br> direction=up height=50 width=200 scrollamount=1 bgcolor=lightyellow </b> <br> <marquee style=”color: #FF0000; font-size: 12pt; font-weight: bold; font-family: Verdana” direction=”up” height=”50″ width=”200″ scrollamount=”1″ bgcolor=”lightyellow”> this is scrolling text</marquee></p> <p><b>Marquee text with <br> direction=left height=20 behavior=alternate scrollamount=10 bgcolor=lightyellow </b> <marquee style=”color: #FF0000; font-size: 12pt; font-weight: bold; font-family: Verdana” direction=”left” height=”20″ behavior=”alternate” scrollamount=”10″ bgcolor=”lightyellow”> this is scrolling text</marquee><br> <br> <b>Marquee text with <br> direction=left height=20 scrollamount=10 bgcolor=lightyellow </b> <marquee style=”color: #FF0000; font-size: 12pt; font-weight: bold; font-family: Verdana” direction=”left” height=”20″ scrollamount=”10″ bgcolor=”lightyellow”> this is scrolling text</marquee><br> <br> <font face=”Verdana”> <b>BLINKING TEXT</b></font></p> </p> <font color=”#FF0000″><b> <BLINK> <font face=”Verdana”>This is the blinking text.</BLINK></b></font> </body> </html> |
||||||||||||||||||||||||
Page in browser will Look Like: | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
In the above example we have used both the <marquee> & <blink> tags and output is shown. In case of <blink> tag it might happen that the text displayed in <blink> tag do not appears to be blinking. It is all because the Internet Explorer do not support the blinking text where as the Netscape Navigator supports. | ||||||||||||||||||||||||
Click Here! to see the animation of Other Tags. | ||||||||||||||||||||||||