Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6615785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:30:18+00:00 2026-05-25T20:30:18+00:00

I am struggling with how to write the correct CSS for positioning some data

  • 0

I am struggling with how to write the correct CSS for positioning some data entry forms. I’m not sure what the “proper” way to do it is.

An example of what I am trying to create a layout for:

Last Name        Middle Initial            First Name            DOB
|||||||||||||    ||||||                    ||||||||||||||||      ||||||||||

City         State         Zip
||||||||     ||||          |||||||||

Basically I have my labels and the ||| are representing my form elements (text boxes, dropdowns etc). I don’t know the proper way to create classes for these elements without just creating one time use classes that specify a specific width that is only for these elements.

Also, how do I get all of these elements aligned properly and multiple items per line? Do I need to float each element?

Would I do something like:

<div class="last-name">
   <div class="label">
       <label>Last Name</label>
   </div>
   <div class="field">
       <input type="text" />
   </div>
</div>

<div class="middle-initial">
   <div class="label">
       <label>Middle INitial</label>
   </div>
   <div class="field">
       <input type="text" />
   </div>
</div>

...

<div class="clear"></div>

last-name and middle-initial etc would all be classes that would be used once and floated to the left. I’m not sure if this is a good way to go about it or not? Is there a better way to do this kind of positioning with CSS so I can avoid using tables?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:30:18+00:00Added an answer on May 25, 2026 at 8:30 pm

    It’s not a bad thing to use table layout when the data you’re laying out is a table! That’s what you have here, imo: a table. So save yourself some grief and treat it that way. We’ve been so beat up by CSS purists and semantic-web lunatics that I suggest the pendulum has swung too far: now we tie ourselves in knots over-CSSifying our layouts. Or at least I do. I spend way too much time trying to avoid table layout.

    The outcome is that a lot of my pages have to do browser checking. And the extra time (hey! the 80-20 rule again!) to deal with browser quirks is way more than it should be. I’d have saved a lot of time, and had more robust pages, if I’d just thought a little bit instead of going for the never-any-tables, always-pure-CSS solution every time. Table handling is solid like a rock in every browser with no problems and no frustrations.

    Just my experience.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm struggling to write Makefiles that properly build my unit tests. As an example,
I have created a very simple nested loop example and am struggling to write
I'm trying to write a regular expression for matching the following HTML. <span class=hidden_text>Some
I'm struggling with PL/SQL functions. I'm trying to write a function which would take
I am trying to write Dijkstra's Algorithm, however I am struggling on how to
I'm trying to write a game using F# and Silverlight and am struggling a
I'm trying to write my first tornado application. The sample example for tornado, shows
I'm struggling to figure out the correct way to do something in MVC which
trying to understand preg_match, struggling to understand how to write and how to access
I'm struggling to write a Windows Service that accesses a website, logs in using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.