For Part 3, you will start from scratch with a new HTML file and a new CSS file. It is important that you get the structure for the columns set correctly. I don't want to cloud the issues involved by asking you to make modifications to your existing files. Within the sample files you download at the beginning of this article, you will find the completed documents for Part 3. You can either create your own documents as you work through this tutorial or read through the code as you build it in the finished documents.
In this section of the tutorial, you will create the containing elements for your form and include the opening and closing form tags. Once you do this, you will be in a position to start adding the form elements to the appropriate containers. The first Captivate demo lays out the structure and includes the form container, the form tags, and the two columns you will need for your layout.
Your first steps are to create an HTML document and save it as TwoColFormLayout.html and then create a new CSS file and save it as TwoCol.css. You can create these documents in the same way you created the original documents in Part 1. Don't forget to create your ie.css file and save that as well. At the end of this tutorial, you will see how you can filter out styles that Internet Explorer does not render properly.
You will also need to structure your site in the same way. Save the HTML file in the root of your site and create a folder called CssFiles, also in the root, to hold your CSS documents. Once again, Part 1 contains all the relevant step-by-step information to complete these part and, of course, the structure is as it should be in the completed download files.
Once it's correctly set, the head of your TwoColFormLayout.html document should look like the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="CSSFiles/TwoCol.css" rel="stylesheet" type="text/css" media="screen" /> <!--[if LTE IE 6]> <link href="CssFiles/ie.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> </head>
The following demo shows you how to build the content structure.
Alternatively, you can complete the following steps:
<div id="Col2"> option.Note: By default, a div will fill the width of its containing element, so there is no real need to set the width to 100%. However, if you don't want the div to fill the container, you need only to edit the width to constrain it.
You now have the structure in place to contain your form elements. You have the formContainer that contains all your code. You have a form inside the formContainer that that holds your Col1 and Col2 divs. The important thing is that the two Col divs are within the form tags in your code. It is of course important to ensure that all your form elements are contained within a form.