472,988 Members | 3,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 software developers and data experts.

fixed and liquid column positioning

Here's what I'm looking to do: fixed left column and a right column
that fills the remainder of the space. I need the ability to position
other elements relative to the borders of the right column. Without
nesting containers, here's the best cross-browser version I could come
up with:

http://www.singley.org/test/two_cols2.html

I see what's wrong - the right column is getting offset by the left
column which pushes the viewport out 200px to the right. But I
couldn't figure out a way to get the widths to work and for my square
box to position relative to the edges of the right container.

I eventually settled on this, which works and uses nested DIVs:

http://www.singley.org/test/two_cols1.html

So, mostly for my own learning, I'd like to know how to implement this
layout without the nested DIV design.

Thanks,

~ E

Dec 6 '05 #1
1 2055
Els
ChitownE wrote:
Here's what I'm looking to do: fixed left column and a right column
that fills the remainder of the space. I need the ability to position
other elements relative to the borders of the right column. Without
nesting containers, here's the best cross-browser version I could come
up with:

http://www.singley.org/test/two_cols2.html

I see what's wrong - the right column is getting offset by the left
column which pushes the viewport out 200px to the right. But I
couldn't figure out a way to get the widths to work and for my square
box to position relative to the edges of the right container.

I eventually settled on this, which works and uses nested DIVs:

http://www.singley.org/test/two_cols1.html

So, mostly for my own learning, I'd like to know how to implement this
layout without the nested DIV design.

#left{
float:left;
width:200px;
background-color: #eee;
height:300px;
}
#right{
margin-left:200px;
position:relative;
background-color: #333;
height:300px;
}
#positioned-item{
position:absolute;
top:50px;
left:50px;
height: 30px;
width: 30px;
border: 1px solid red;
background-color: #fcf;
}

<div id="left">
</div>
<div id="right">
<div id="positioned-item">&nbsp;</div>
</div>

I don't know why you want to position that item that way, a better set
of stylerules for that same html would be:

#left{
float:left;
width:200px;
background-color: #eee;
height:300px;
}
#right{
margin-left:200px;
border:1px solid
background-color: #333;
border:1px solid #333; /* to keep margins of content inside */
height:300px;
}
#positioned-item{
height: 30px;
width: 30px;
border: 1px solid red;
background-color: #fcf;
margin-left:49px;
margin-top:49px;
}

Not tested (2x).

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Electric Boys - Dying To Be Loved
Dec 6 '05 #2

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

Similar topics

179
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
6
by: Mason A. Clark | last post by:
Masters: On two or three-column layouts, one column often has a list of links. Scrolling the page hides them. I'm aware there's supposed to be the ability to fix the column (frame-like). I...
1
by: Frances Del Rio | last post by:
don't know if I'll succeed, have spent a lot of time already trying to figure this out: I would like to position a footer (co. name, address, etc..) at the bottom of browser page, in such a way...
8
by: oj | last post by:
Please, bare with me. I'm new to CSS and would like to ask for some advice on my current project. I have an existing table based layout that serves as the main template for a .Net application I've...
25
by: Michael Schuerig | last post by:
I'm trying to do something seemingly very simple, but it's brought me close to crushing my head on the keyboard. All I want is a table where the head row is fixed and the body columns below are...
2
by: Eric Lindsay | last post by:
What problems are there in using position: fixed; with left: %; and right: %; to do pages that look like a typical boring framed site. A full width header and a footer and the rest of the content...
2
by: Eric Lindsay | last post by:
I hope someone can help, before I start thinking tables have a lot of merit after all. I am trying to achieve a two column layout, with source code div order main content, right side navigation,...
31
by: Sarita | last post by:
Hello, this might sound stupid, but I got a really nice homepage template which unfortunately is a 3-Column Fixed Width CSS format. Now I don't have any content for the right column and would...
3
chathura86
by: chathura86 | last post by:
hi, i want to have tow column in my design (divide the page in to two parts) where i want left column to be liquid while the right column has the width of 200px so when the window re size only...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.