The scope of an HTML tag is simply everything that is contained from the opening of that tag to the closing of that tag. In the previous tutorial, the topic was where exactly the 3 tags close (where there scope ends), as where they end is where their scope ends. In this tutorial, the topic is the scope of the tags.
Take the following for example:
< font color="red" >
I am red.
< /font >
I am default.
< font color="green" >
I am green.
< /font >
In this code, there are two < font > tags. One of them makes the color red and the other green. Since the scope of an HTML tag is defined as everything from the start tag to the end tag, then in this example, the scope of the tag that defined the color as red would include the sentence "I am red."
The next sentence "I am default." is out of the scope of the tag that defined the color to be red because that < /font > tag has already closed it. The < font > tag for the green color has not yet begun, so the text "I am default." will be out of the scope of both of these < font > tags and will be colored in the default color defined by the < body > or what the web browser's settings are set to.
Finally the tag that sets the color to green will only include the text "I am green." as that is the only text in the scope of that tag.
When writing HTML, you should try to make sure you don't accidentally end up using an HTML tag that had already gone out of scope.
Published by Kantus
I love writing short stories and humor articles, but tend to stick with topics that are discoverable by search engines and capable of spreading virally. View profile
- Vintage Fabric Gift TagsYou can create the most darling little vintage gift tags using vintage fabric from your collection.
Basic HTML TutorialAnyone can learn HTML. HTML is the easiest programming language out there. In this tutorial I will cover the basic HTML tags and have you building a webpage in minutes.- Beginner's Photoshop Tutorial: Learning to Create Your Own BrushesWhether you're an advanced user or a beginner, this Photoshop tutorial is perfect if you're interested in creating and using your own brushes in Photoshop. Your personalized brushes are perfect for numerous things, in...
- HTML Tutorial #4 - the Precedence of Nested HTML Tags
- What Are META Tags?
- Christmas Cookie Cutter Gift Tags
- Photoshop Tutorial: How to Add Two Different Cool Frames to Your Photos
- Photoshop Tutorial: Create a Professional Charcoal Drawing Out of Any Photo
- Photoshop Tutorial: How to Cut and Put Images on a Transparent Background
- Photoshop Tutorial: How to Create Glamor Photos




1 Comments
Post a CommentPHP users can try the htmLawed script to balance/properly-nest HTML tags -- http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/index.php.