Making My Fields Horizontal Instead of All Vertical

Reply

Join Date: Jun 2009
Posts: 11
Reputation: groogruxking40 is an unknown quantity at this point 
Solved Threads: 0
groogruxking40 groogruxking40 is offline Offline
Newbie Poster

Making My Fields Horizontal Instead of All Vertical

 
0
  #1
Jul 6th, 2009
see here: http://www.christiancouriernewspaper...ontactpage.php

What I want is for 7 fields (Name-State) on the Left just how they are
Then I want the remaining fields (Country- the spam question) on the right

I would like to have it so it all fits on one page without having to scroll

any ideas/suggestions?

the .css file is below

HTML and CSS Syntax (Toggle Plain Text)
  1. /*
  2. ----------------------------------------------------------------
  3. GBCF-V3 BLUE STYLE SHEET - MIKE CHERIM HTTP://GREEN-BEAST.COM
  4. ----------------------------------------------------------------
  5. To use for testing, this stylesheet must be named default.css
  6. */
  7.  
  8. /* === form div and elements ======================================= */
  9.  
  10. #form-div {
  11. font-family : verdana, helvetica, palatino sans, tahoma, arial, sans-serif;
  12. width : 70%;
  13. margin : auto;
  14. color : #FF8C00 ;
  15. line-height : 1.2em;
  16. }
  17.  
  18. #form-div p.form-footer {
  19. margin : -35px 2px 20px 13px;
  20. }
  21.  
  22. #form-div p.form-footer a {
  23. color : #003366;
  24. }
  25.  
  26. #form-div p.form-footer a:hover, #form-div p.form-footer a:focus, #form-div p.form-footer a:active {
  27. color : #000;
  28. text-decoration : none;
  29. }
  30.  
  31. #form-div p.form-footer a:focus, #form-div p.form-footer a:active {
  32. background-color : #eee;
  33. }
  34.  
  35.  
  36. /* === form div link styles ======================================== */
  37.  
  38. #form-div a {
  39. color : #FF6600;
  40. }
  41.  
  42. #form-div a:hover, #form-div a:focus, #form-div a:active {
  43. color : #000;
  44. text-decoration : none;
  45. }
  46.  
  47. #form-div a:focus, #form-div a:active {
  48. background-color : #eee;
  49. }
  50.  
  51.  
  52. /* === success and error message/results box ======================= */
  53.  
  54. #form-div p.success, #form-div p.error, #form-div p.center {
  55. color : #fff;
  56. /* color : #000; (lite colors option - uncomment to use) */
  57. padding : 1px 4px;
  58. border : 1px solid #000;
  59. background-color : #003366;
  60. /* background-color : #bfccd9; (lite colors option - uncomment to use) */
  61. margin : 10px 3px;
  62. text-align : center;
  63. }
  64.  
  65. #form-div p.error {
  66. background-color : #bb0000;
  67. /* background-color : #edbaba; (lite colors option - uncomment to use) */
  68. }
  69.  
  70. #form-div p.error a, #form-div p.success a {
  71. color : #ffff7f;
  72. }
  73.  
  74. #form-div p.center {
  75. text-align : center;
  76. background-color : #edbaba;
  77. color : #000;
  78. margin-top : -3px;
  79. padding : 0px 4px;
  80. }
  81.  
  82. #form-div p.error a:hover, #form-div p.error a:focus, #form-div p.error a:active,
  83. #form-div p.success a:hover, #form-div p.success a:focus, #form-div p.success a:active {
  84. color : #eee;
  85. background-color : #bb0000;
  86. }
  87.  
  88. #form-div p.success a:hover, #form-div p.success a:focus, #form-div p.success a:active {
  89. background-color : #003366;
  90. }
  91.  
  92.  
  93. /* === structural form elements ==================================== */
  94.  
  95. form#gbcf-form { }
  96.  
  97. fieldset.main-set,
  98. fieldset.req-set,
  99. fieldset.opt-set {
  100. border : 1px solid #eee;
  101. padding : 5px;
  102. }
  103.  
  104.  
  105. /* === textural form elements ====================================== */
  106.  
  107. #form-div legend {
  108. font-weight : bold;
  109. }
  110.  
  111. #form-div legend span { }
  112.  
  113. legend.main-legend {
  114. color : #777;
  115. font-size : 100%;
  116. }
  117.  
  118. legend.req-legend,
  119. legend.opt-legend {
  120. color : #777;
  121. font-size : 60%;
  122. }
  123.  
  124. legend.main-legend span { }
  125. legend.main-legend { }
  126.  
  127. legend.req-legend span { }
  128. legend.req-legend {
  129. margin-left : -2px;
  130. }
  131.  
  132. legend.opt-legend span { }
  133. legend.opt-legend {
  134. margin-left : -2px;
  135. }
  136.  
  137. label.req-label, label.opt-label {
  138. color : #FF6600;
  139. font-size : 60%;
  140. }
  141.  
  142. label.opt-label.check {
  143. float : right;
  144. padding : 0;
  145. margin : 1px 4px;
  146. cursor : pointer;
  147. }
  148.  
  149. label.opt-label.main-label {
  150. margin : 0 2px;
  151. font-weight : bold;
  152. font-size : 75%;
  153. }
  154.  
  155. label.opt-label.main-label span {
  156. font-weight : normal;
  157. color : #FF6600;
  158. font-sze : 60%;
  159. }
  160.  
  161. label.opt-label.main-label span.req, label span.req {
  162. font-weight : bold;
  163. color : #c70000;
  164. }
  165.  
  166. label.req-label.explain {
  167. color : #666;
  168. font-size : .8em;
  169. }
  170.  
  171. label.req-label.explain:hover {
  172. color : #000;
  173. }
  174.  
  175. /* === control and interface form elements ========================= */
  176. /*
  177. note: In this section you will see the hover/focus styles for the
  178. inputs. For example: input:hover, input:focus. You will also see
  179. these names applied as classes: input.hover, input,focus, for
  180. example. This is not done by mistake. Those classes are needed for
  181. the JavaScript focus script (files/focus.js) for IE 7 and older.
  182. */
  183.  
  184. input.text-long.address, input.text-long.address:hover, input.text-long.address:focus,
  185. input.text-long.address.hover, input.text-long.address.focus {
  186. border-bottom : 0;
  187. margin-bottom : 0;
  188. padding-bottom : 2px;
  189. border-bottom : 1px dotted #bbb;
  190. }
  191.  
  192. input.text-long.address2, input.text-long.address2:hover, input.text-long.address2:focus,
  193. input.text-long.address2.hover, input.text-long.address2.focus {
  194. border-top : 0;
  195. margin-top : 0;
  196. padding-top : 2px;
  197. border-top : 1px dotted #bbb;
  198. }
  199.  
  200. input.checkbox {
  201. border : 1px solid #999;
  202. width : .9em;
  203. height :.9em;
  204. padding : 0;
  205. margin : 0;
  206. cursor : pointer;
  207. }
  208.  
  209. input.checkbox:hover, input.checkbox.hover,
  210. input.checkbox:focus, input.checkbox.focus {
  211. border : 1px solid #666;
  212. }
  213.  
  214. input.text-short,
  215. input.text-med,
  216. input.text-long,
  217. select.select,
  218. textarea.textarea {
  219. font : 0.6em verdana, helvetica, palatino sans, tahoma, arial, sans-serif;
  220. border : 1px solid #999;
  221. background-color : #fffffe;
  222. cursor : text;
  223. padding : 1px 2px;
  224. }
  225.  
  226. select.select {
  227. padding : 1px 0;
  228. }
  229.  
  230. input.text-short {
  231. width : 75px;
  232. }
  233.  
  234. input.text-med, select.select {
  235. width : 150px;
  236. }
  237.  
  238. input.text-long {
  239. width : 175px;
  240. }
  241.  
  242. textarea.textarea {
  243. width : 220px;
  244. height : 100px;
  245. }
  246.  
  247. select.select, select.select option {
  248. cursor : pointer;
  249. }
  250.  
  251. input.text-short:focus, input.text-short.focus,
  252. input.text-med:focus, input.text-med.focus,
  253. input.text-long:focus, input.text-long.focus,
  254. select.select:focus, input.select.focus,
  255. textarea.textarea:focus, textarea.textarea.focus {
  256. border : 1px solid #666;
  257. background-color : #ffe;
  258. }
  259.  
  260. input.button {
  261. font : 0.9em verdana, helvetica, palatino sans, tahoma, arial, sans-serif;
  262. font-weight : bold;
  263. margin-top : 8px;
  264. padding : 1px 10px;
  265. cursor : pointer;
  266. float : right;
  267. clear : both;
  268. color : #003366;
  269. }
  270.  
  271. input.button:hover, input.button.hover,
  272. input.button:focus, input.button.focus {
  273. color : #333;
  274. }
  275.  
  276. /* because IE6 sucks - if you have a conditionally served IE6 style sheet add this to it */
  277. * html input.button {
  278. border : 1px solid #666;
  279. }
  280.  
  281.  
  282. /* EOF - Created by Mike Cherim @ http://green-beast.com =========== */



thanks ahead of time!!!
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: Making My Fields Horizontal Instead of All Vertical

 
0
  #2
Jul 6th, 2009
Quick and dirty example:
HTML and CSS Syntax (Toggle Plain Text)
  1. <div style="float:right;">
  2. form fields go here
  3. </div>

The key is the "float" attribute. Just play around with width/height to get what you want exactly.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 11
Reputation: groogruxking40 is an unknown quantity at this point 
Solved Threads: 0
groogruxking40 groogruxking40 is offline Offline
Newbie Poster

Re: Making My Fields Horizontal Instead of All Vertical

 
0
  #3
Jul 6th, 2009
ok where do i put it exactly in my stylesheet?

can you copy/paste exactly what needs to go in there?

thank you very much for the quick reply
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,316
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Making My Fields Horizontal Instead of All Vertical

 
0
  #4
Jul 6th, 2009
hate to rain on your parade
the form is laid out in tables
not css
css is only used to set the label colours
change the table code
  1. <table>
  2. <tr>
  3. <td>
  4. <fieldset class="req-set" style="border:0">
  5. <legend class="req-legend"><span>Required</span></legend>
  6. <td>
  7. <label id="name-error" for="name" class="req-label">Name</label><br />
  8. <input type="text" class="text-med" name="name" value="" size="32" maxlength="60" id="name" /><br />
  9. <label id="email-error" for="email" class="req-label">Email</label><br />
  10. <input type="text" class="text-med" name="email" value="" size="32" maxlength="60" id="email" /><br />
  11. </fieldset>
  12. <td>
  13. <!--optional set-->
  14. <fieldset class="opt-set" style="border:0">
  15. <legend class="opt-legend"><span>Required</span></legend>
  16. <label id="org-error" for="org" class="opt-label">Organization</label><br />
  17. <input type="text" class="text-med" name="org" value="" size="32" maxlength="60" id="org" /><br />
  18. <label id="phone-error" for="phone" class="opt-label">Phone</label><br />
  19. <input type="text" class="text-med" name="phone" value="" size="32" maxlength="15" id="phone" /><br />
  20. <label id="address1" for="address" class="opt-label">Address</label><br />
  21. <input type="text" class="text-long address" name="address" value="" size="42" maxlength="30" id="address" />
  22. <label id="addy2-error" for="address2" class="opt-label address2" style="position:absolute;left:-9000px;"><br />
  23. Address (continued)</label><br />
  24. <input type="text" class="text-long address2" name="address2" value="" size="42" maxlength="30" id="address2" /><br />
  25. <label id="city-error" for="city" class="opt-label">City/town</label><br />
  26. <input type="text" class="text-med" name="city" value="" size="32" maxlength="60" id="city" /><br />
  27. <label id="state-error" for="state" class="opt-label">State/province</label><br />
  28. <input type="text" class="text-med" name="state" value="" size="32" maxlength="40" id="state" /><br />
  29. <label id="postcode-error" for="postcode" class="opt-label">Zip/postal code</label><br />
  30. <input type="text" class="text-short" name="postcode" value="" size="22" maxlength="20" id="postcode" /><br />
  31. <label id="country-error" for="country" class="opt-label">Country</label><br />
  32. <input type="text" class="text-short" name="country" value="" size="22" maxlength="40" id="country" /><br />
  33. <label id="website-error" for="website" class="opt-label">Website</label><br />
  34. <input type="text" class="text-med" name="website" value="http://" size="32" maxlength="80" id="website" /><br />
  35. <label id="optmenu-error" for="option-menu" class="opt-label">Referred by</label><br />
  36. <select class="select" name="option-menu" id="option-menu">
  37. <option value="" selected="selected">Select one</option>
  38. <option value="A print advertisement">A print advertisement</option>
  39. <option value="A web advertisement">A web advertisement</option>
  40. <option value="Friend or family member">Friend or family member</option>
  41. <option value="Another source (below)">Another source (below)</option>
  42. </select><br />
  43. </fieldset>
  44.  
  45. <!--required set 2-->
  46. <td>
  47. <fieldset class="req-set" style="border:0">
  48. <legend class="req-legend"><span>Required</span></legend>
  49. <label id="subject-error" for="subject" class="req-label">Subject</label><br />
  50. <select class="select" name="subject" id="subject">
  51. <option value="" selected="selected">Select one</option>
  52. <option value="Quick comment">Quick comment</option>
  53. <option value="Quick question">Quick question</option>
  54. <option value="Site problem report">Site problem report</option>
  55. <option value="Advertising Query">Advertising Query</option>
  56. <option value="Ad Submission">Ad Submission</option>
  57. </select><br />
  58. <label id="message-error" for="message" class="req-label">Message</label><br />
  59. <textarea class="textarea" rows="12" cols="60" name="message" id="message"></textarea><br />
  60. <label id="antispam-error" for="antispam" class="req-label">Is faith cold, lukewarm or hot?</label><br />
  61. <input type="text" class="text-short" name="antispam" value="" size="22" maxlength="10" id="antispam" />
  62. <label class="req-label explain">- Your answer proves you're a person</label><br />
  63. </fieldset>
  64.  
  65. <div style="position:absolute;left:-9000px;">
  66. <label id="honeypot-error" for="honeypot" class="opt-label">Leave this anti-spam trap empty</label><br />
  67. <input type="text" class="text-med" name="honeypot" value="" size="32" maxlength="255" id="honeypot" /><br />
  68. <input type="hidden" name="hidden" value="fkf41452949cfa08e092dd53547ac40e15id05f3877bcef7091f6f85f8f1ab6b3f01mc" id="hidden" alt="hidden" />
  69. </div>
  70. <label id="cc-opt-error" class="opt-label check">
  71. <input class="checkbox" type="checkbox" name="cc-opt" id="cc-opt" value="cc" />&nbsp;&nbsp;Check for email copy</label><br />
  72. <input type="submit" class="button" name="ID05F3877BCEF7091F6F85F8F1AB6B3F01MC" id="ID05F3877BCEF7091F6F85F8F1AB6B3F01MC" value="Submit" alt="Submit" /><br />
  73. </fieldset></tr></table>
  74. </form>
Preserving Copyright Notice
  1. <!--GBCF-v3 Secure and Accessible PHP Contact Form by Mike Cherim @ http://green-beast.com (v3 (c) 2007-2009)-->

Move the input fields labels etc into the table cells you want them to be in, to get the alignment you require, or design the same form in css, you can do it, preserving the field names
Last edited by almostbob; Jul 6th, 2009 at 6:51 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 11
Reputation: groogruxking40 is an unknown quantity at this point 
Solved Threads: 0
groogruxking40 groogruxking40 is offline Offline
Newbie Poster

Re: Making My Fields Horizontal Instead of All Vertical

 
0
  #5
Jul 7th, 2009
Originally Posted by almostbob View Post
hate to rain on your parade
the form is laid out in tables
not css
css is only used to set the label colours
change the table code
  1. <table>
  2. <tr>
  3. <td>
  4. <fieldset class="req-set" style="border:0">
  5. <legend class="req-legend"><span>Required</span></legend>
  6. <td>
  7. <label id="name-error" for="name" class="req-label">Name</label><br />
  8. <input type="text" class="text-med" name="name" value="" size="32" maxlength="60" id="name" /><br />
  9. <label id="email-error" for="email" class="req-label">Email</label><br />
  10. <input type="text" class="text-med" name="email" value="" size="32" maxlength="60" id="email" /><br />
  11. </fieldset>
  12. <td>
  13. <!--optional set-->
  14. <fieldset class="opt-set" style="border:0">
  15. <legend class="opt-legend"><span>Required</span></legend>
  16. <label id="org-error" for="org" class="opt-label">Organization</label><br />
  17. <input type="text" class="text-med" name="org" value="" size="32" maxlength="60" id="org" /><br />
  18. <label id="phone-error" for="phone" class="opt-label">Phone</label><br />
  19. <input type="text" class="text-med" name="phone" value="" size="32" maxlength="15" id="phone" /><br />
  20. <label id="address1" for="address" class="opt-label">Address</label><br />
  21. <input type="text" class="text-long address" name="address" value="" size="42" maxlength="30" id="address" />
  22. <label id="addy2-error" for="address2" class="opt-label address2" style="position:absolute;left:-9000px;"><br />
  23. Address (continued)</label><br />
  24. <input type="text" class="text-long address2" name="address2" value="" size="42" maxlength="30" id="address2" /><br />
  25. <label id="city-error" for="city" class="opt-label">City/town</label><br />
  26. <input type="text" class="text-med" name="city" value="" size="32" maxlength="60" id="city" /><br />
  27. <label id="state-error" for="state" class="opt-label">State/province</label><br />
  28. <input type="text" class="text-med" name="state" value="" size="32" maxlength="40" id="state" /><br />
  29. <label id="postcode-error" for="postcode" class="opt-label">Zip/postal code</label><br />
  30. <input type="text" class="text-short" name="postcode" value="" size="22" maxlength="20" id="postcode" /><br />
  31. <label id="country-error" for="country" class="opt-label">Country</label><br />
  32. <input type="text" class="text-short" name="country" value="" size="22" maxlength="40" id="country" /><br />
  33. <label id="website-error" for="website" class="opt-label">Website</label><br />
  34. <input type="text" class="text-med" name="website" value="http://" size="32" maxlength="80" id="website" /><br />
  35. <label id="optmenu-error" for="option-menu" class="opt-label">Referred by</label><br />
  36. <select class="select" name="option-menu" id="option-menu">
  37. <option value="" selected="selected">Select one</option>
  38. <option value="A print advertisement">A print advertisement</option>
  39. <option value="A web advertisement">A web advertisement</option>
  40. <option value="Friend or family member">Friend or family member</option>
  41. <option value="Another source (below)">Another source (below)</option>
  42. </select><br />
  43. </fieldset>
  44.  
  45. <!--required set 2-->
  46. <td>
  47. <fieldset class="req-set" style="border:0">
  48. <legend class="req-legend"><span>Required</span></legend>
  49. <label id="subject-error" for="subject" class="req-label">Subject</label><br />
  50. <select class="select" name="subject" id="subject">
  51. <option value="" selected="selected">Select one</option>
  52. <option value="Quick comment">Quick comment</option>
  53. <option value="Quick question">Quick question</option>
  54. <option value="Site problem report">Site problem report</option>
  55. <option value="Advertising Query">Advertising Query</option>
  56. <option value="Ad Submission">Ad Submission</option>
  57. </select><br />
  58. <label id="message-error" for="message" class="req-label">Message</label><br />
  59. <textarea class="textarea" rows="12" cols="60" name="message" id="message"></textarea><br />
  60. <label id="antispam-error" for="antispam" class="req-label">Is faith cold, lukewarm or hot?</label><br />
  61. <input type="text" class="text-short" name="antispam" value="" size="22" maxlength="10" id="antispam" />
  62. <label class="req-label explain">- Your answer proves you're a person</label><br />
  63. </fieldset>
  64.  
  65. <div style="position:absolute;left:-9000px;">
  66. <label id="honeypot-error" for="honeypot" class="opt-label">Leave this anti-spam trap empty</label><br />
  67. <input type="text" class="text-med" name="honeypot" value="" size="32" maxlength="255" id="honeypot" /><br />
  68. <input type="hidden" name="hidden" value="fkf41452949cfa08e092dd53547ac40e15id05f3877bcef7091f6f85f8f1ab6b3f01mc" id="hidden" alt="hidden" />
  69. </div>
  70. <label id="cc-opt-error" class="opt-label check">
  71. <input class="checkbox" type="checkbox" name="cc-opt" id="cc-opt" value="cc" />&nbsp;&nbsp;Check for email copy</label><br />
  72. <input type="submit" class="button" name="ID05F3877BCEF7091F6F85F8F1AB6B3F01MC" id="ID05F3877BCEF7091F6F85F8F1AB6B3F01MC" value="Submit" alt="Submit" /><br />
  73. </fieldset></tr></table>
  74. </form>
Preserving Copyright Notice
  1. <!--GBCF-v3 Secure and Accessible PHP Contact Form by Mike Cherim @ http://green-beast.com (v3 (c) 2007-2009)-->

Move the input fields labels etc into the table cells you want them to be in, to get the alignment you require, or design the same form in css, you can do it, preserving the field names

OK-
I got it all figured out how I want, now I need to know how to remove those goofy looking fieldset outlines under the SPAM question and the SUBMIT button...

any ideas?

thanks for all the help
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,316
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Making My Fields Horizontal Instead of All Vertical

 
0
  #6
Jul 7th, 2009
to remove the fieldset boxes, remove the
<fieldset></fieldset> tags,
to retain the fieldsets without the borders, set
fieldset { border:none; } in the css
Last edited by almostbob; Jul 7th, 2009 at 12:58 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC