Solved

Need help on HTML5 Form

Posted on 2014-01-29
8
360 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 52

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 52

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
 

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 52

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 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now