Home arrow HTML arrow Page 4 - HTML Methods to Remember and Use Effectively
HTML

HTML Methods to Remember and Use Effectively


In the years since the first development of HTML, many other computer languages have been developed to enhance the pages displayed on the Internet. These languages include JavaScript, VBS, Perl, ASP, and .Net. However, I will show you that you can enhance your web page just using HTML. This is especially important if you are new to web page development and have not had the time to learn another language.

Author Info:
By: Stephen Davies
Rating: 3 stars3 stars3 stars3 stars3 stars / 15
December 05, 2007
TABLE OF CONTENTS:
  1. · HTML Methods to Remember and Use Effectively
  2. · Page Layout
  3. · Text Enhancing
  4. · Use of Classes

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
HTML Methods to Remember and Use Effectively - Use of Classes
(Page 4 of 4 )

Use of Classes

To add appearing/disappearing text to our page we need to make use of the span tag again. We will also use the style tag. Now I know this is used with CSS, but in this application, it functions alone. The following code is a little bit longer than what we have been dealing with, mainly because of its repetitious nature.

<style>

.time { behavior: url(#default#time2);}

</style>


<span>Every second text will appear:</span>

<span class="time" begin="1">One Thousand</span>

<span class="time" begin="2">Two Thousand</span>

<span class="time" begin="3">Three Thousand</span>

<span class="time" begin="4">Finished!</span>


This only works because we have the time2 statement in our time class in the style tag. Normally the style tag is placed in the head tag, but in this case, it can be copied as is to the body of our web page.

The above code will display the selected text, each second, one after the other until it stops at 4 seconds. The span tag allows us to use the style tag's class (i.e. time) without using any other formatting tags. Notice we incremented the number of seconds by one in each begin attribute.

This is why the text is displayed in succession. With the following line of code replacing the span tags above, we can make the text appear and disappear: <span class="time" begin="1" dur="1">One Thousand</span>. All we did to accomplish this was add the dur attribute (duration), giving it a value of 1 (second).

Finally, we can make the selected text appear and disappear one after another at the same position on the screen (i.e. on top of each other) by using the following code:

<:span style="position:absolute;top:10;left:10" class="time" begin="0"
dur="1">Every second text will appear:</span>
.

All we did was add the style attribute, which enables us to specify the position of the selected text. We also started with the first begin attribute as 0. If we replace the selected text with an image, as we did with the marquee, we will get an even better effect.

There are still many other HTML methods we can use to enhance our web pages, but these will give us a head start.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials