Forum Moderators: not2easy

Message Too Old, No Replies

Position all controls or just containers?

What is the correct amount of controls to position

         

jzickgra

5:43 pm on Oct 14, 2007 (gmt 0)

10+ Year Member



I am starting a new web project with some other developers. I am trying to understand the right amount of positioning that should be used for layout of pages with quite a bit of form based content.

Currently, one of the developers wants to have div tags and absolute position those and then absolute position each of the form elements. This seems like a mistake to me as it could mean a ton of work when we want to reposition the containers or modify layout. Its also a lot of css tags that get declared.

Is it better to absolute position every element or is it better to only absolute position the container and then let the elements within be contained with no positioning.

What do others use?

Thanks!

Marshall

8:15 pm on Oct 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



jzickgra, welcome to WebmasterWorld.

Absolute positioning has its purpose, from what you are describing, sounds like you are going to create a coding monster, IMHO.

I would suggest letting thins fall where the may using three class which would cover each row. Example (adjust numbers as you see fit):

.holder {
width: 100%;
height: 30px;
margin: 0;
padding: 0;
clear: both; /* optional, can't hurt */
}
.description {
width: 45%;
height: 30px;
text-align: right;
float: left;
}
.input {
width: 45%;
height: 30px;
text-align: left;
float: right;
}

Then the HTML

<div class="holder">
<div class="description">Enter Name</div>
<div class="input"><input type"".....></div>
</div>

Then just repeat this down the page.

Marshall