You group sections of an HTML page when you want to perform an action on multiple elements. For example, you might group a series of paragraphs in order to apply a single style to the entire section, instead of to each paragraph individually. You use the HTML tags DIV and SPAN to group your elements in this way:
You can add DIV and SPAN tags to the page designer by highlighting the elements you want to group, then choosing the DIV or SPAN icon from the toolbar. Visual Basic automatically inserts the appropriate opening and closing tags in the HTML for your page. The resulting DIV and SPAN elements appear in the treeview, and you can assign IDs and write code for them.
Grouping elements in DIV and SPAN tags can be an important part of your coding efforts, because it allows you to manipulate precise portions of the page. The following HTML code shows an example of DIV and SPAN tags used to manipulate parts of a Web page:
<DIV id="client-fullname" class="client">
<SPAN class="client-lastname">Last name:</SPAN>
<SPAN class="client-firstname">First name:</SPAN>
</DIV>
In this example, a DIV tag with the ID "client-fullname" groups the fields that specify the client's first and last name. Each label is part of a SPAN tag. If you wanted to perform an operation on all of the fields on the form, you could use the DIV tag to do so. If you wanted to perform an operation on just one item in the form, you could use the appropriate SPAN tag.
To add a DIV or SPAN tag to your page
Note You can highlight the elements in either the drawing surface or in the treeview.
Visual Basic inserts opening and closing tags around your selection.
For More Information For more information on DIV and SPAN tags, see the W3C documentation at http://www.w3.org.