Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Side comment: Maybe you shouldn't use tables to layout this form but fieldsets, it would leave you with more flexibility. For example if you decide to have the labels and input fields on top of each other in a more narrow column...</p> <p>your example without tables (looks also much prettier):</p> <pre><code>&lt;style type="text/css"&gt; &lt;!-- form { /* set width in form, not fieldset (still takes up more room w/ fieldset width */ font: 100% verdana, arial, sans-serif; margin: 0; padding: 0; min-width: 500px; max-width: 600px; width: 560px; } form fieldset { /* clear: both; note that this clear causes inputs to break to left in ie5.x mac, commented out */ border-color: #000; border-width: 1px; border-style: solid; padding: 10px; /* padding in fieldset support spotty in IE */ margin: 0; } form fieldset legend { font-size: 1.1em; /* bump up legend font size, not too large or it'll overwrite border on left */ /* be careful with padding, it'll shift the nice offset on top of border */ } form label { display: block; /* block float the labels to left column, set a width */ float: left; width: 150px; padding: 0; margin: 5px 0 0; /* set top margin same as form input - textarea etc. elements */ text-align: right; } form input, form textarea { /* display: inline; inline display must not be set or will hide submit buttons in IE 5x mac */ width: auto; /* set width of form elements to auto-size, otherwise watch for wrap on resize */ margin: 5px 0 0 10px; /* set margin on left of form elements rather than right of label aligns textarea better in IE */ } textarea { overflow: auto; } /* uses class instead of div, more efficient */ form br { clear: left; /* setting clear on inputs didn't work consistently, so brs added for degrade */ } --&gt; &lt;/style&gt; &lt;div id="pnlSubmitComments"&gt; &lt;form&gt; &lt;fieldset&gt; &lt;label for="Comments"&gt; Name: &lt;/label&gt; &lt;input id="Name" name="Name" type="text" value="" /&gt;&lt;br /&gt; &lt;label for="Comments"&gt; Email: &lt;/label&gt; &lt;input id="Email" name="Email" type="text" value="" /&gt;&lt;br /&gt; &lt;label for="Comments"&gt; Questions: &lt;/label&gt; &lt;textarea id="Comments" name="Comments"&gt; &lt;/textarea&gt;&lt;br /&gt; &lt;label for="spacing"&gt;&lt;/label&gt; &lt;input id="btnSubmitComments" name="btnSubmitComments" type="submit" value="Submit Questions" /&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>Now to your main question. I would do it as follows:</p> <p>I would use the id's of the different layout columns I want to use the form in. So if I use it in my main column () I would write CSS accordingly like so:</p> <pre><code>#main .pnlSubmitComments form fieldset { /*your CSS*/ } </code></pre> <p>and for the side column respectively</p> <pre><code>#side .pnlSubmitComments form fieldset { /*your CSS*/ } </code></pre> <p>You can have control over each element by assigning classes like so:</p> <pre><code>&lt;input type="text" class="email" name="email" id="email" /&gt; </code></pre> <p>and then you do exactly as described above:</p> <pre><code>#main .email { /*your css for the .email textbox/* } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload