- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI am trying to design a page using a tableless css layout. Here is the problem: a modal panel opens up using ajax. The layout is contained within the modal panel which renders as a span (the modal panel), no other choice here. I am trying to create two separate cloumns within the modal panel, one on the left and the other on the right. For some reason, whenever I attempt this the controls within the left and right divs go out in a straight line horizontally instead of vertically in a straight line, even if I set the widths for the divs. It seems as if the div tag borders are not being honored. I have tried both static and relative positioning with the same effect. Could someone point me in the right direction to solving this problem?
here is a sample scenario:
<code>
<span>
<div id="divleft" class="position:relative;w
label
textbox
label
textbox
etc.
</div>
<div id="divright" class="position:relative;w
label
textbox
label
textbox
etc.
</div>
</span>
</code>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: TNamePosted on 2007-10-18 at 22:03:20ID: 20106756
Hi, the inline style should be defined as idth:150px ;float:lef t" idth:150px ;float:lef t"
l1/DTD/xht ml1-transi tional.dtd ">
style="position:relative;w
and not
class="position:relative;w
The text boxes and labels will align in a row because they are inline elements that do not cause line-breaks by default. You can specify "display:block;" for them (or use <br> elements for instance)
Also, spans are inline elements, and inline elements are not designed to contain block elements as divs. If it has to be a span, you could assign that span "display:block;" so it would behave as a div.
Have a look at this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm
<html>
<head>
<style>
span { background-color: #ddd; display:block; overflow:hidden; }
input.blockElement { display:block; margin:4px; }
#divleft, #divright { border:1px solid #f00; }
</style>
</head>
<body >
<span id="container">
<div id="divleft" style="width:450px; float:left">
<label>aaa</label><br>
<input type="text" class="blockElement">
<label>bbb</label><br>
<textarea style="width:400px;"> </textarea>
<input type="text" class="blockElement">
<input type="text" class="blockElement">
</div>
<div id="divright" style="width:450px; float:right">
<input type="text" class="blockElement">
<input type="text" class="blockElement">
<input type="text" class="blockElement">
<input type="text" class="blockElement">
</div>
</span>
</body>
</html>