Web Design Stuff
HTML Tutorials    CSS Tutorials    Web Hosting   Resources
Create a Web Page 101
Making Web Pages Intro What is a Web Page? Why Make a Web Page? The History of HTML Learn HTML or XHTML?
Basic HTML
Basic HTML Tutorials Basic HTML Necessities How to Make a Web Page How to Edit a Web Page The Basics of HTML Tags Basic HTML Page Structure HTML Attributes
HTML Font Codes
HTML Font Codes Intro HTML Font Color Codes HTML Font Size Codes HTML Font Style Codes HTML Bold/Italic Codes Combining Font Codes
Formatting Text
Formatting Text Intro Making Paragraphs Miscellaneous Formatting Headings & Subheadings Creating Hyperlinks
Using Graphics
Using Graphics on the Web Add Graphics to Your Pages Graphics and Accessibility How to Align Graphics Page Color & Background Graphics as Hyperlinks Horizontal Rules
Creating Tables
HTML Tables Tutorials HTML Table Fundamentals Background & Border Color Table Frames & Rules Table Width and Alignment Cells 1 -Space & Alignment Cells 2 -Row Column Span Cells 3 -Width & Height
Making Lists
HTML Lists Tutorials Bulleted Lists Numbered Lists Definition Lists
HTML Frames
HTML Frames Tutorials Using Frames for Layout Advanced Frame Layouts Putting Hyperlinks in Frames Frame Border Width Color, Margin and Control Problems with Frames SmartFrames: A Solution SSI: An Alternative to Frames
Web Page Forms
Making Feedback Forms A Simple Feedback Form Installing NMS FormMail Debugging Your Setup My Web Host is Out to Lunch User Input Components Text Fields Checkboxes & Radio Buttons Dropdown Menus Push Buttons Layout and Presentation
Basic CSS
Basic CSS Tutorials What is CSS? Why You Should Use CSS How to Use CSS Inline Styles Embedded Style Sheets External Style Sheets Class Selectors ID Selectors Combining Selectors
CSS Properties
CSS Properties Intro Font Styles Width, Height & Spacing Borders Backgrounds Position Float & Alignment Hyperlinks
All About Web Hosting
Hosting Your Own Website What is a Web Host? Your Website's Home Page Building a Website Offline About Free Web Hosting Best Free Web Hosting Commercial Web Hosting How to Get a Domain Name Ecommerce Web Hosting Web Hosting Terminology
Free Web Design Tools
Best Free Website Tools Best Free Text Editors Best Free Graphics Editors Free Website Analysis Tools
Setting Up HTML Kit
HTML Kit Introduction How to install HTML Kit Screenshot Breakdown Basic Configuration Overall Appearance Shortcuts and Startup Editing Window Customizing Toolbars Using the Favorites Tab Making a New Actions Bar Odds and Ends
Free Templates
Free Website Templates Two Column Fixed Width Three Column Liquid Layout Miscellaneous Templates Dynamic Menu Effects Two Column Experimental Terms of Use About These Templates
Website Templates Help
Getting Started Template Zip File Download How to Edit Your Template What to Edit in the HTML How to Add Your Logo Making a Website
Web Design Tips
Web Design Basics Tables vs. Tableless Using Tables for Layout Example Table Layouts World's Crappiest Web Page
Twitter Backgrounds
Twitter Backgrounds Intro Cool Twitter Backgrounds Cool Twitter Backgrounds 2 Plain Twitter Backgrounds Dark Twitter Backgrounds Best Twitter Backgrounds Cute Twitter Backgrounds Music Twitter Backgrounds Music Twitter Backgrounds 2 Twitter Backgrounds 101 TERMS OF USE
All About Web Browsers
What is a Web Browser? Mozilla Firefox Internet Explorer Opera How to Set Up Firefox Top 5 Firefox Extensions
 
Contact
Post Some Feedback Send Me An Email Iron Spider Blog About Iron Spider... Site Conventions
 
 
 

 

Layout and Presentation

 
ON THIS PAGE
  • Fieldset
  • Legend
  • Example Form (advanced)
  • Example Source Code
  • A Quick Rundown
  • Structure At A Glance
 
A web form filled with a daunting array of text fields, checkboxes, radio buttons and dropdown menus may actually scare a potential user away instead of prompting them to submit information. Hence, the layout and presentation of your web form can have a profound impact on how inviting it looks and how easy it is to discern what it is all about.

HTML tables can be used very effectively to layout your form components. You can also use two special form elements, fieldset and legend, which will help spiff up your form's appearance and structure. These elements are described below.


  • Fieldset ~ The fieldset element can be used to draw a box around a group of form components. This element requires both start and end tags. It has no special attributes to speak of however it should be used in conjunction with the legend element otherwise it's rather pointless. Each set of <fieldset>...</fieldset> tags contains all the form components you wish to be grouped together.
  • Legend ~ The legend element creates a text label for each fieldset. It must be used inside the fieldset element and should be the first element appearing after the <fieldset> start tag. The legend element requires both start and end tags. Each set of <legend>...</legend> tags contains the text you wish to use to label the respective fieldset.

An Example Form (Advanced)


Below is an example of an advanced feedback form using all the form components described on the previous pages. Below that you will find:
  • The HTML source code (which you can copy and modify)
  • A quick rundown of the structure
  • The structure at a glance


PERSONAL
Your name:
Comments:
Email address:

FOR BREAKFAST I HAD
Eggs
Toast
Bacon
Sausage
Orange juice
Cereal
Muffin
Bacon
Pancakes
Cold pizza

MY PREFERENCES
I usually have:

A light breakfast
A BIG breakfast
I like my coffee with:


  


 


SOURCE CODE


  


A Quick Rundown of the Structure


  1. The entire form in the example above is placed inside in a set of <div>...</div> tags. The style attribute is used in this 'wrapper' div element to apply some CSS properties which do the following:

    • Set the width at 500 pixels ( width: 500px; )
    • Apply a border 2 pixels in width on all sides
    • Color the border light on the top and left sides and dark on the bottom and right sides to render a 3D effect ( e.g. border-top: 2px solid white; )
  2. The form element also has the style attribute inserted to apply some CSS properties which do the following:

    • Strip the default white space that appears around the form element ( margin: 0px )
    • Move the form components (textfields, checkboxes, etc.) away from the border of the form element ( padding: 10px )
    • Set the background of the form to a light gray
      ( background: #d9d9d9; )
  3. The form is divided into three distinct sections. Each section is wrapped in a set of <fieldset>...</fieldset> tags which draws a nice border around each group of components. The legend element is inserted at the start of each fieldset to give it a label.

  4. Inside each fieldset is an HTML table. The table's width is set at 100% to spread the fieldset out to fill the wrapping div element. Each table cell contains an individual form component.

Structure At A Glance


Here's the source code of the example form stripped down and color-coded so that you can visualize the structure at a glance. (Note: Table rows and cells are implied.)


<div style="CSS properties...">

<form action="" method="post" style="CSS properties...">

<fieldset>
<legend>Fieldset label</legend>
<table>Form components...</table>
</fieldset>
<br>

<fieldset>
<legend>Fieldset label</legend>
<table>Form components...</table>
</fieldset>
<br>

<fieldset>
<legend>Fieldset label</legend>
<table>Form components...</table>
</fieldset>
<br>

<button type="submit">Submit</button>&nbsp;&nbsp;
<button type="reset">Reset</button>

</form>

</div>
<br>







Best Free Stuff
for webmasters

Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates

See also:

Best Free Web Hosting

 

If you need a .COM web address, you can get one quick and easy at...

www.GoDaddy.com
<~ BACK TOP INTRO
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell