Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] structure of a form

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #150249
    Nishant
    Participant

    Hello, i have a little confusion regarding structure of this form..(http://i.imgur.com/cvdFIzk.png). should i divide this form like i did in this pic? My main problem coming in last block.. a div encloses button and that text.. is that semantically right? one more problem here. (http://i.imgur.com/WX3w741.png) . In this 2nd pic, you can see a google map(i will use image at the moment). In this belongs to this form.. or i just need to adjust form according to it..thanks

    #150250
    Paulie_D
    Member

    You can structure the internals of a form pretty much any way you want. Some people use tables, some divs…some even use definitions lists

    Over on HTMl5Doctor they have a form ‘snippet’ like this:

    <form id="app-login" action="process.php">
    <fieldset>
    <legend>Login Details</legend>
    <div>
      <label for="user-name">Username:</label>
    
      <input name="user-name" type="email" placeholder="Your username is your email address" required autofocus>
    </div>
    <div>
    
      <label for="password">Password:</label>
      <input name="password" type="password" placeholder="6 digits, a combination of numbers and letters" required>
    </div>
    <div>
      <input name="login" type="submit" value="Login">
    </div>
    </fieldset>
    </form>
    

    Divs have no semantic meaning in and of themselves…so can use them however you wish.

    So divs are fine…and it would be my preferred option.

    #150251
    Paulie_D
    Member

    As for the map….I would include it in the form ‘area’ because it’s simpler to arrange all the elements.

    I realise that it’s not really a form element as such but so what?

    #150263
    Nishant
    Participant

    thanks for the reply. :)

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.