Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need help on HTML5 Form

Posted on 2014-01-29
8
Medium Priority
?
371 Views
Last Modified: 2014-01-30
Hi Experts,

I am newbie to web design and need help on designing a page using HTML5 .I have attached a form to this question and need sample working code for this using HTML5 with similar alignment and layout (Please see comments in the attached screenshot)

Thanks in Advance
html5form.png
0
Comment
Question by:ksd123
  • 4
  • 4
8 Comments
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39817207
Let me know if you need help understanding this.    

http://jsbin.com/padasQ_28350882/1/edit?html,output

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
 <style>
   
label{display:block;width:30%;float:left;}
.row{margin-bottom:10px;}
.box{border-color:black;border-style:solid;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:20px;overflow: hidden;}
.rounded{border-radius:15px;}
h2{font-size:90%;margin-top:1%}
.col_sm{width:30%;float:left;}
.col_lg{width:60%;;float:left;}
  </style>
</head>
<body>
  <form>
    <div class="row">
      <label for "activity">Activity</label>
      <select id="activity" name="activity">
        <option value="1">One</option>
        <option value="2">two</option>
        <option value="3">three</option>
      </select>
      
    </div>
      <div class="row">
        <label for "name">Name</label>
        <input id="name" name="name">
      </div>
    
  </form>
  <div class="row box rounded">
    <h2>Project Status</h2>
     <div class="col_sm">Proj1</div>
    <div class="col_lg">Proj data</div>  
    <div class="col_sm">Proj2</div>
    <div class="col_lg">Proj data</div> 
  </div>
  <div class="row box rounded">
    <h2>Subject Status</h2>
    <div class="col_sm">subj1</div>
    <div class="col_lg">subj datasubj datasubj datasubj datasubj datasubj datasubj data</div>  
    <div class="col_sm">subj2</div>
    <div class="col_lg">subj data</div> 
  </div>
  
  
</body>
</html>

Open in new window

0
 

Author Comment

by:ksd123
ID: 39817318
Thank you for the quick turn around.

I was told not to use bootstrap  so I need above code without using bootstrap classes.

The other important thing I was told is the page layout should not be  responsive design ie.when I minimize/maximize the page  the textboxes / dropdowns / rounded tables etc. width /height should not shrink /grow with the screen size they all should have  fixed size.  

Thanks once again.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39817347
Bootstrap is not used here.  Just change the width's from % to px if you want it fixed.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:ksd123
ID: 39817378
I am still confused .What are these classes row box rounded,col-sm,col-lg,row in Div's? where we have defined these classes? and also when I change the widht from % to px the page layout is messed up and not looking  good.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39817407
I will make it easier, just wrap a container that is fixed

The container sets the width to 900px.  Make this whatever you want.
By making the label a block and floating it left, it will be similar to using div's and the label will be to the left of the input.

The row sets off another block and we give it a bit of a margin at the bottom to space things out.
the box class creates the border and we add some padding on the inside
the rounded class makes the corners round
the col_sm is similar to bootstrap but not the same (col_sm_12) and I simply made it 30% and floated left.
col_lg is 60 % and floating the 2 divs inside a block (row) creates the 2 columns.

Sample http://jsbin.com/padasQ_28350882/2/
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
 <style>
   .container{width:900px;}
label{display:block;width:30%;float:left;}
.row{margin-bottom:10px;}
.box{border-color:black;border-style:solid;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:20px;overflow: hidden;}
.rounded{border-radius:15px;}
h2{font-size:90%;margin-top:1%}
.col_sm{width:30%;float:left;}
.col_lg{width:60%;;float:left;}
  </style>
</head>
<body>
  <div class="container">
  <form>
    <div class="row">
      <label for "activity">Activity</label>
      <select id="activity" name="activity">
        <option value="1">One</option>
        <option value="2">two</option>
        <option value="3">three</option>
      </select>
      
    </div>
      <div class="row">
        <label for "name">Name</label>
        <input id="name" name="name">
      </div>
    
  </form>
  <div class="row box rounded">
    <h2>Project Status</h2>
     <div class="col_sm">Proj1</div>
    <div class="col_lg">Proj data</div>  
    <div class="col_sm">Proj2</div>
    <div class="col_lg">Proj data</div> 
  </div>
  <div class="row box rounded">
    <h2>Subject Status</h2>
    <div class="col_sm">subj1</div>
    <div class="col_lg">subj datasubj datasubj datasubj datasubj datasubj datasubj data</div>  
    <div class="col_sm">subj2</div>
    <div class="col_lg">subj data</div> 
  </div>
  </div>
  
</body>
</html>

Open in new window

0
 

Author Comment

by:ksd123
ID: 39817508
Thank you so much. Just  I want the (Activity) dropdown width to be equal with (Name) textbox width.Now the dropdown width is very small compared to textbox width.
0
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39818062
http://jsbin.com/padasQ_28350882/3/

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
 <style>
   .container{width:900px;}
label{display:block;width:30%;float:left;}
.row{margin-bottom:10px;}
.box{border-color:black;border-style:solid;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:20px;overflow: hidden;}
.rounded{border-radius:15px;}
h2{font-size:90%;margin-top:1%}
.col_sm{width:30%;float:left;}
.col_lg{width:60%;;float:left;}
   input{width:75px;}
   select{width:80px;}
  </style>
</head>
<body>
  <div class="container">
  <form>
    <div class="row">
      <label for "activity">Activity</label>
      <select id="activity" name="activity">
        <option value="1">One</option>
        <option value="2">two</option>
        <option value="3">three</option>
      </select>
      
    </div>
      <div class="row">
        <label for "name">Name</label>
        <input id="name" name="name">
      </div>
    
  </form>
  <div class="row box rounded">
    <h2>Project Status</h2>
     <div class="col_sm">Proj1</div>
    <div class="col_lg">Proj data</div>  
    <div class="col_sm">Proj2</div>
    <div class="col_lg">Proj data</div> 
  </div>
  <div class="row box rounded">
    <h2>Subject Status</h2>
    <div class="col_sm">subj1</div>
    <div class="col_lg">subj datasubj datasubj datasubj datasubj datasubj datasubj data</div>  
    <div class="col_sm">subj2</div>
    <div class="col_lg">subj data</div> 
  </div>
  </div>
  
</body>
</html>

Open in new window

I would suggest spending a few hours on html and css basics if you are going to do this on a regular basis.  It will save you  a ton of time and headeachs down the road.  http://www.codecademy.com/learn
0
 

Author Closing Comment

by:ksd123
ID: 39820385
Thank you
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question