<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">Articles</title>
    <subtitle type="text">Articles:The personal site of Steven Killen, web designer and flash developer</subtitle>
    <link rel="alternate" type="text/html" href="http://www.whoisskillen.co.uk/index.php/site/index/" />
    <link rel="self" type="application/atom+xml" href="http://www.whoisskillen.co.uk/index.php/site/atom/" />
    <updated>2009-03-05T11:12:25Z</updated>
    <rights>Copyright (c) 2009, Steven Killen</rights>
    <generator uri="http://expressionengine.com/" version="1.6.0">ExpressionEngine</generator>
    <id>tag:whoisskillen.co.uk,2009:03:04</id>


    <entry>
      <title>Forms without the Flab</title>
      <link rel="alternate" type="text/html" href="http://www.whoisskillen.co.uk/index.php/site/forms_without_the_flab/" />
      <id>tag:whoisskillen.co.uk,2009:index.php/site/index/1.23</id>
      <published>2009-03-04T14:00:00Z</published>
      <updated>2009-03-05T11:12:25Z</updated>
      <author>
            <name>Steven Killen</name>
            <email>skillen19@gmail.com</email>
                  </author>

      <content type="html"><![CDATA[
        <p>The problem with forms on the web seems to be that they require extra markup in order to display correctly.  Often you will see web forms encased in  &lt;p&gt; tags or worse &lt;td&gt; tags, that obscure the semantic flow of the  form. The form would be so much more readable and simpler if we could just use  &lt;label&gt; tags together with their appropriate form input field.</p>
            <p>I decided to design the form in my own site using just the  form tags and a bit of css markup, so the code just reads:</p>
 <pre><code>&lt;form&gt;</code>
            <code>&lt;fieldset&gt;</code>
            		<code>&lt;label&gt;&lt;/label&gt;</code>
                 	<code>&lt;input/&gt;</code>
                 	<code>&lt;label&gt;&lt;/label&gt;</code>
                 	<code>&lt;input/&gt;</code>
                  	<code>&lt;label&gt;&lt;/label&gt;</code>
                  	<code>&lt;input /&gt;</code>
                  	<code>&lt;label&gt;&lt;/label&gt;</code>
                  	<code>&lt;textarea&gt;&lt;/textarea&gt;</code>
                  	<code>&lt;input/&gt;</code>
             <code>&lt;/fieldset&gt;</code>
            
  <code>&lt;/form&gt;</code> </pre>
          <p>I  have made the form as adaptable as possible so a couple of changes to the css  file will give you a form with left aligned labels, right aligned labels or  stacked. You can find the <a title="live demo of the form" href="http://www.whoisskillen.co.uk/form-demo.html">live demo here</a>.</p>
          <p>Here  is the basic code for a basic contact form. Just standard labels and input  fields wrapped in a fieldset tag.</p>
          <pre><code>&lt;form  id='freeform' method=&quot;post&quot; action=&quot;contact/&quot; &gt;</code>
          		<code>&lt;fieldset&gt;</code>
                	    <code>&lt;label  for=&quot;name&quot;&gt;Name&lt;/label&gt;</code>
                        <code>&lt;input type=&quot;text&quot;  name=&quot;name&quot; id=&quot;name&quot; /&gt;</code>
                        <code>&lt;label  for=&quot;email&quot;&gt;Email&lt;/label&gt;</code>
                        <code>&lt;input type=&quot;text&quot;  name=&quot;email&quot; id=&quot;email&quot; /&gt;</code>
                        <code>&lt;label  for=&quot;website&quot;&gt;Website&lt;/label&gt;</code>
                        <code>&lt;input type=&quot;text&quot;  name=&quot;website&quot; id=&quot;website&quot; /&gt;</code>
                        <code>&lt;label  for=&quot;comments&quot;&gt;Comments&lt;/label&gt;</code>
                        <code>&lt;textarea name=&quot;comments&quot; id=&quot;comments&quot; rows=&quot;7&quot; cols=&quot;5&quot;&gt;
                        &lt;/textarea&gt;</code>
                        <code>&lt;input class=&quot;submit&quot;  type=&quot;submit&quot; /&gt;</code>
                 <code>&lt;/fieldset&gt;</code>
  <code>&lt;/form&gt;</code></pre>
            <p>Now  for the css. I decided to use floats for the form layout for the simple reason  that it is the most adaptable and works in the most popular browsers. At some  point I may look at the possibility of doing it with display=”table”.</p>
          <p>To  achieve a form left-aligned fields like in the example opposite simply add </p>
          <pre>label  {
            display: block;
            float: left;
          }</pre>
          <p>Then  add the width you wish the labels to be, the form works just as well with a  fluid layout as static, so percentage value are fine.</p>
          <p>Then  stipulate the width value for the input and textarea form elements, as long as  the widths of the labels and the input fields do not exceed the width of the  containing element or 100% then the form will line up correctly. The form uses  the simple css columns technique that we all know well, regularly used for  layouts but rarely for forms.</p>
          <p>Of  course the form is looking a bit cramped and plain at the moment, so let’s add  some space and style. Remember when adding padding  or margins to the elements in one column, to  add it to them in the other one.</p>
          <p>Set  the text size to 14px:</p>
          <pre>form  {<br />
            font-size: 0.875em;<br />
            }</pre>
          <p>I  find the optimal amount of space to have with this text size is:</p>
          <pre>label  {
            margin: 0.5em 0;
            padding: 4px;
            }
            input,  textarea {
            margin: 0.5em 0;
            padding: 4px;
            }</pre>
          <p>Add  widths to the label and input elements:</p>
          <pre>label  {
            margin: 0.5em 0;
            padding: 4px;
            width: 15%;
            
            }
            input,  textarea {
            margin: 0.5em, 0;
            padding: 4px;
            width: 15%;
            }</pre>
          <p>Add 15.5% to the left margin of submit button. The extra 0.5% is to accommodate  for the padding on the labels.</p>
          <p>This  give you the basics of a rough, fluid form, which will display correctly in all  but the smallest resolutions.  The form  is very flexible and only requires the smallest alterations to change the look  of the form, for instance; input text-align: right to the label element will  align all labels on the right so it has a closer spacial relationship with the  input element. Alternatively if you would like the form to display vertically you can remove float: left from the label elements. It is also good practice to  adjust the margins here so the relation between the from label and the input  field is more obvious. </p>
          <p>There  you have it, I have tested the form in all browsers and there are no known  issues. Below is an live demo of the form, I have added background colours,  borders and hover effects to the form to make it more attractive. One note of  caution, I have applied the background colour of the form to the fieldset  element as Internet Explorer doesn’t display a background on the form element.</p>
          <p><a title="live demo of the completed form" href="http://www.whoisskillen.co.uk/form-demo.html">See  the live demo here</a>.</p>
 
      ]]></content>
    </entry>

    <entry>
      <title>New Year&#8217;s Ambitions</title>
      <link rel="alternate" type="text/html" href="http://www.whoisskillen.co.uk/index.php/site/new_years_ambitions/" />
      <id>tag:whoisskillen.co.uk,2009:index.php/site/index/1.21</id>
      <published>2009-01-02T12:16:01Z</published>
      <updated>2009-01-05T17:34:35Z</updated>
      <author>
            <name>Steven Killen</name>
            <email>skillen19@gmail.com</email>
                  </author>

      <category term="Website"
        scheme="http://www.whoisskillen.co.uk/index.php/site/C5/"
        label="Website" />
      <content type="html"><![CDATA[
        <p>I can&#8217;t believe it&#8217;s 2009 already, I&#8217;m hoping it won&#8217;t go by as quickly as 2008 did but somehow I suspect it will be even quicker. I have many ambitions for the new year which I hope to achieve with my main New Year&#8217;s resolution which is to procrastinate less and make better use of the time I have.
</p>
<h3>A Fistful of Aims</h3><p>
<ul>
<li>My major aim this year is to get projects completed quicker and more efficiently. This is especially true of personal projects which often languish behind when I have more important work to do, one thing I would like to achieve is a faster redesign of this site; which brings me to my next aim&#8230;</li>
<li>Redesign the site and attempt to innovate how the information is processed. One big ambition of mine is to rethink how my blog presents information, most likely utilising JavaScript to filter information based on the user&#8217;s needs. I am currently in the process of doing this, I&#8217;m at what I believe to be the most difficult stage, coming up with the most efficient way to present information. With the site structure now in place, thanks to this design, I hope the only difficulty when I get to coding is setting the layout. Does it ever work out that way though?! Of course this new design will not work if there is no content so my next aim is:</li>
<li>Write more blog posts! Not just for the sake of it but to get my ideas out there and to have a voice on the web.</li>
<li>Participate in the web community more. I hope to find the time to add more comments to the blogs I read and build a strong connection in the community. Maybe even update twitter once in a while.</li>
</ul>
<h3>To sum up</h3><p>
<p>In contrast to the rest of the world, I&#8217;m actually very positive about this year, I&#8217;m moving into a much bigger flat with my girlfriend in early January, so looking forward to the extra room. I&#8217;m looking forward to the extra space as I believe it will benefit my workflow no end and help to achieve a few of those goals, above. I should also be more comfortable, financially, which, with any luck, will allow me to purchase the new Macbook early this year. So here we go with the new year and the promise of more posts to come! 
</p> 
      ]]></content>
    </entry>


</feed>