473,499 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble getting two <div> columns to align

http://www.scottbell.org/sunrise/
http://www.scottbell.org/sunrise/css/v2.css

On the above URL I'm trying to get a sidebar menu on the right to align
with the page text except it seems to sit just underneath the text
instead. Can anyone suggest what I need to do? I've tried playing with
float: and clear:, I've managed to get the two aligned but the
container gets a 0 height when I need it to change with the text.

TIA,

Scott

Jul 21 '05 #1
2 1931
On 18 Feb 2005 14:04:43 -0800 Scott Bell wrote:
http://www.scottbell.org/sunrise/
http://www.scottbell.org/sunrise/css/v2.css On the above URL I'm trying to get a sidebar menu on the right to align
with the page text except it seems to sit just underneath the text
instead. Can anyone suggest what I need to do? I've tried playing with
float: and clear:, I've managed to get the two aligned but the
container gets a 0 height when I need it to change with the text. TIA, Scott


For one, you have #container set to 630px wide.
Then #central is set to 620px wide.
#sidebar is set to 160px wide.
620+160=780 So with the container being fixed, something has to give.
You also show a margin-left of 440 while the division is floated right.
630-440=190.
You need to keep track of your math so everything falls into place.
I would suggest removing the margin-left in #sidebar.
And it might help if you tell the browser which units to use.
Why are you using only 50% or less of the space?
Jul 21 '05 #2

Richard wrote:
For one, you have #container set to 630px wide.
Then #central is set to 620px wide.
#sidebar is set to 160px wide.
620+160=780 So with the container being fixed, something has to give.
My HTML/CSS was pretty buggy actually. The #central <div> was supposed
to be a container but that wasn't even closed, not sure why I even had
a #central. I rewrote the HTML/CSS pretty much from scratch and it now
works, so I'm guessing there was a problem with my math somewhere.
You also show a margin-left of 440 while the division is floated right. 630-440=190.
You need to keep track of your math so everything falls into place.
I would suggest removing the margin-left in #sidebar.
And it might help if you tell the browser which units to use.
Why are you using only 50% or less of the space?


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2094
by: F. Da Costa | last post by:
Hi, I' looking to retrieve ProdName1 form the <tr> below. <tr id="1-1-1" class="even"> <td> <div class="tier4"> <a href="#" class="leaf"></a> ProdName1 </div>
61
24396
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
4
3470
by: Hal Canary | last post by:
<div align="center"> does not seem to be identical to <div style="text-align:center">, as this example http://home.earthlink.net/~canaryh3/example.html points out. Yet the 'align' attribute...
2
12166
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
5
1776
by: Stan R. | last post by:
Greetings. I have a couple of questions concerning CSS layouts, as apposed to the old <tablemethod for creating layouts . Even after spending the last few days searching all over Google Groups, I...
3
7839
by: rsteph | last post by:
I'm using two divs to create a shadowed-box type effect. Within the top div I want to put an image. I can get the image to center right to left, but not top to bottom. I'm making a series of boxes,...
5
13389
by: Agix | last post by:
Hi there, Please check out : http://clarifysolutions.co.uk/certenroll/ The source is included below. This page is a test, so I can play about with paddings, margins and layouts using divs as...
10
14126
by: neverquit | last post by:
hi , Iam Nagesh,Begineer in using Ajax,well i have been using ajax in application, i have faced a problem while placing the responseTEXT into the <div> tag positioned inside the <form> tag iam...
8
10011
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4920
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.