3 replies [Last post]
Adagio
Offline
newbie
Last seen: 14 years 43 weeks ago
Timezone: GMT+1
Joined: 2006-02-06
Posts: 2
Points: 0

I tried to do a search, but couldn't find anything, but I wasn't sure what to search for with this problem. I'm sorry if there already is a thread on this

My problem is best described with a picture:

As you can see the textboxes are vertically just below the treeview, but they should be on the same line as it. Unfortunatly I haven't found a way to do it. I have tried several tutorials on this, but none of them has helped me

Here's the basic structure for the code I have now:

<div id="home" class="page">
<div id="sidebar">
(...)
</div>
<div id="content">
<div id="CreatePurchase" class="container">
<div class="left">
(...)
</div>
<div class="right">
(...)
</div>
</div>
</div>
</div>

div.left
{
width: 45%;
float: left;
}

div.right
{
width: 45%;
float: right;
}

div.container
{
border: 0px solid #000000;
overflow: hidden;
width: 100%;
}

#sidebar
{
float: left;
margin-left: -10px;
width: 150px;
}

#content
{
margin-left: 170px;
}

Btw, I'm coding in asp.net 2.0, so the divs under the content div is loaded from another file (using content page)

Anonymous
Anonymous's picture
Guru

2 columns inside a div with two columns

Try putting the float before the "treeview".

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 8 years 10 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

2 columns inside a div with two columns

Is there a "clear:left" or "clear:both" somewhere in the content of #content, perhaps on the form element?

If there is you need to contain the effects of that clear. Do that by either:
- floating #content
- using overflow (auto or hidden) on #content

Adagio
Offline
newbie
Last seen: 14 years 43 weeks ago
Timezone: GMT+1
Joined: 2006-02-06
Posts: 2
Points: 0

2 columns inside a div with two columns

Thanks for the help, it works now Smile