Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts

    Help with a form design

    Hi,

    I'm completely stuck on a form design. I'd like it to look like the following:



    However, I can't seem to get it right and it's doing my head in, can anyone help?

    Code:
    <!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>Form test</title>
    <style type="text/css">
    body{
    	font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; 
    	font-size:12px;
    }
    
    /* ----------- My Form ----------- */
    .myform{
    	margin:0 auto;
    	width:400px;
    	padding:14px;
    }
    
    /* ----------- basic styles ----------- */
    	#basic{
    		border:solid 2px #DEDEDE;
    	}
    	
    	#basic label{
    	    display:inline;
    		font-weight:bold;
    		text-align:right;
    		width:140px;
    		float:left;
    	}
    	
    	#basic p.heading {
    	float:left;
    	font-weight:bold;
    	color:#cc0000;
    	font-size:15px;
    	}
    	
    	#basic.radio{
    	  /* - Radio buttons only - */
    	  clear:left;
    	  display:inline;
    	}
    	
    	#basic input{
    	    /* - All other input elements - */
    		clear:left;
    		font-weight:bold;
    	}
    
    </style>
    </head>
    
    <body>
    <div id="basic" class="myform">
      <form id="form1" name="form1" method="post" action="">
        
    	<p class="heading">Heading One</p> 
    	<input type="radio" name="the_answer" value="Yes" class="radio">
        <label>Yes</label>
        <input type="radio" name="the_answer" value="No" class="radio">
        <label>No</label>
    	
    	<p class="heading">Heading Two</p> 
    	<input type="radio" name="the_answer2" value="Yes" class="radio">
        <label>Yes</label>
        <input type="radio" name="the_answer2" value="No" class="radio">
        <label>No</label>
        
    	<p class="heading">Heading Three (textbox)</p> 
    	<input type="text" name="textfield" />
        <label>Password</label>
    	
      </form>
    </div>
    
    </body>
    </html>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    See Pretty accessible forms.

    Btw, a heading should be inside any one of the tag h1-h6, to make it semantic.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Not sure if anyone else is having this issue in this thread, but your linked image appears to be protected. Every time I navigate into this thread I am prompted to provide a log-in:


    The server www.inspireaway.co.uk at site requires a username and password.

    Warning: This server is requesting that your username and password be sent in an insecure manner (basic authentication without a secure connection).
    I can't really help you without being able to see the example...
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #4
    Regular Coder
    Join Date
    Oct 2005
    Posts
    336
    Thanks
    43
    Thanked 2 Times in 2 Posts
    [QUOTE=Rowsdower!;752256]Not sure if anyone else is having this issue in this thread, but your linked image appears to be protected. Every time I navigate into this thread I am prompted to provide a log-in:



    Yes I keep having the log-in appearing aswell.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •