473,412 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Fixed "frame" at top, main text doesn't flow under it

I've searched Google and the group archives, and came up empty, but
maybe I just haven't selected the right search term.

This concerns only the screen -- printing isn't an issue. I'm also
not concerned about the appearance of the page in IE6 as long as the
page is still usable.

I want to have two pseudo-frames, using only CSS and no JS. The top
"frame", 4em high, is a menu, and I want it to stay at the top of the
viewport. The rest of the page is the text. The menu items all
point to various anchors, <h2 id-...and similar, in the page.

I've got the menu in place using position:fixed. And using a
padding-top, I have the text starting below the menu. But as soon as
I scroll the text it slides under the menu, and when I click a link
in the menu the anchor text is a the top of the viewport, under the
window.

Is there a way to set up these pseudo-frames, or can I truly not do
it in CSS2?

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Sep 30 '08 #1
9 3053
On 2008-09-30, Stan Brown <th************@fastmail.fmwrote:
I've searched Google and the group archives, and came up empty, but
maybe I just haven't selected the right search term.

This concerns only the screen -- printing isn't an issue. I'm also
not concerned about the appearance of the page in IE6 as long as the
page is still usable.

I want to have two pseudo-frames, using only CSS and no JS. The top
"frame", 4em high, is a menu, and I want it to stay at the top of the
viewport. The rest of the page is the text. The menu items all
point to various anchors, <h2 id-...and similar, in the page.

I've got the menu in place using position:fixed. And using a
padding-top, I have the text starting below the menu. But as soon as
I scroll the text it slides under the menu, and when I click a link
in the menu the anchor text is a the top of the viewport, under the
window.

Is there a way to set up these pseudo-frames, or can I truly not do
it in CSS2?
You don't need to do position: fixed. Divide the page up with absolutely
positioned divs and make each of them overflow: scroll.

This kind of thing:

.frame
{
position: absolute;
left: 0;
right: 0;
overflow: scroll;
}
.top
{
top: 0;
height: 4em;
}
.main
{
top: 4em;
bottom: 0;
}

....

<div class="frame top">
</div>

<div class="frame main">
</div>
Sep 30 '08 #2
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:

I want to have two pseudo-frames, using only CSS and no JS. The top
"frame", 4em high, is a menu, and I want it to stay at the top of the
viewport. The rest of the page is the text. The menu items all
point to various anchors, <h2 id-...and similar, in the page.
....

Is there a way to set up these pseudo-frames, or can I truly not do
it in CSS2?

You don't need to do position: fixed. Divide the page up with absolutely
positioned divs and make each of them overflow: scroll.

This kind of thing:

.frame
{
position: absolute;
left: 0;
right: 0;
overflow: scroll;
}
Nice idea Ben...

<http://dorayme.890m.com/alt/pseudoFrames.html>

--
dorayme
Sep 30 '08 #3
On 2008-09-30, dorayme <do************@optusnet.com.auwrote:
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:

I want to have two pseudo-frames, using only CSS and no JS. The top
"frame", 4em high, is a menu, and I want it to stay at the top of the
viewport. The rest of the page is the text. The menu items all
point to various anchors, <h2 id-...and similar, in the page.
...
>
Is there a way to set up these pseudo-frames, or can I truly not do
it in CSS2?

You don't need to do position: fixed. Divide the page up with absolutely
positioned divs and make each of them overflow: scroll.

This kind of thing:

.frame
{
position: absolute;
left: 0;
right: 0;
overflow: scroll;
}

Nice idea Ben...

<http://dorayme.890m.com/alt/pseudoFrames.html>
What does height* mean? I had a look at view source and saw it there.

Maybe it's a typo and that's why you also set background: #fcc on body.

Using that #fifth link is a nice idea-- you couldn't do that with
frames.
Oct 1 '08 #4
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
On 2008-09-30, dorayme <do************@optusnet.com.auwrote:
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:

I want to have two pseudo-frames, using only CSS and no JS. The top
"frame", 4em high, is a menu, and I want it to stay at the top of the
viewport. The rest of the page is the text. The menu items all
point to various anchors, <h2 id-...and similar, in the page.
...

Is there a way to set up these pseudo-frames, or can I truly not do
it in CSS2?

You don't need to do position: fixed. Divide the page up with absolutely
positioned divs and make each of them overflow: scroll.

This kind of thing:

.frame
{
position: absolute;
left: 0;
right: 0;
overflow: scroll;
}
Nice idea Ben...

<http://dorayme.890m.com/alt/pseudoFrames.html>

What does height* mean? I had a look at view source and saw it there.
Just my quick and dirty way to remove it for a moment. I forgot to
remove it. I could bot see it being necessary
>
Maybe it's a typo and that's why you also set background: #fcc on body.

Using that #fifth link is a nice idea-- you couldn't do that with
frames.
I don't think this is quite so, you can do it in frames. You just link
to whatever#id in the target doc. Oh yes! I just remembered, you are of
the modern generation which thinks iFrames whereas I think the T model
job, real frames! <g>

By the way, the first thought that struck me in looking at OP's problem
was that he could have made fixed work (at least on FF and Safari) by
attending to backgrounds:

<http://dorayme.890m.com/alt/positionFixed.html>

But yours was more interesting.

--
dorayme
Oct 1 '08 #5
In article <do**********************************@web.aioe.org >,
dorayme <do************@optusnet.com.auwrote:
bot
not

--
dorayme
Oct 1 '08 #6
On 2008-10-01, dorayme <do************@optusnet.com.auwrote:
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
>On 2008-09-30, dorayme <do************@optusnet.com.auwrote:
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
I want to have two pseudo-frames, using only CSS and no JS. The top
"frame", 4em high, is a menu, and I want it to stay at the top of the
viewport. The rest of the page is the text. The menu items all
point to various anchors, <h2 id-...and similar, in the page.

...

Is there a way to set up these pseudo-frames, or can I truly not do
it in CSS2?

You don't need to do position: fixed. Divide the page up with absolutely
positioned divs and make each of them overflow: scroll.

This kind of thing:

.frame
{
position: absolute;
left: 0;
right: 0;
overflow: scroll;
}

Nice idea Ben...

<http://dorayme.890m.com/alt/pseudoFrames.html>

What does height* mean? I had a look at view source and saw it there.

Just my quick and dirty way to remove it for a moment. I forgot to
remove it. I could bot see it being necessary
>>
Maybe it's a typo and that's why you also set background: #fcc on body.

Using that #fifth link is a nice idea-- you couldn't do that with
frames.

I don't think this is quite so, you can do it in frames. You just link
to whatever#id in the target doc. Oh yes! I just remembered, you are of
the modern generation which thinks iFrames whereas I think the T model
job, real frames! <g>
No I was thinking of real frames this time. I'm sure you're right and it
does work.
By the way, the first thought that struck me in looking at OP's problem
was that he could have made fixed work (at least on FF and Safari) by
attending to backgrounds:

<http://dorayme.890m.com/alt/positionFixed.html>
Yes that works too, and means you get to scroll the main "frame" with
the proper viewport scrollbar. But quite jerky in Firefox because their
implementation of position: fixed is crap.
Oct 1 '08 #7
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
On 2008-10-01, dorayme <do************@optusnet.com.auwrote:
>
By the way, the first thought that struck me in looking at OP's problem
was that he could have made fixed work (at least on FF and Safari) by
attending to backgrounds:

<http://dorayme.890m.com/alt/positionFixed.html>

Yes that works too, and means you get to scroll the main "frame" with
the proper viewport scrollbar. But quite jerky in Firefox because their
implementation of position: fixed is crap.
I had heard of this jerkiness and have raised it myself at times but I
notice not a trace of such jerkiness in my Mac FF3 with the above URL
(nor in any other of my browsers. But I have not tested on Windows).

Now, I am talking simple scrollbar with mouse, not scroll wheels

------------
(Reminder to myself, must get one of these... I miss it when I have had
a session on a Windows box, they all have scroll wheels with their mice)

--
dorayme
Oct 1 '08 #8
Wed, 01 Oct 2008 08:47:56 +1000 from dorayme
<do************@optusnet.com.au>:
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
This kind of thing:

.frame
{
position: absolute;
left: 0;
right: 0;
overflow: scroll;
}

Nice idea Ben...

<http://dorayme.890m.com/alt/pseudoFrames.html>
My thanks to you both. This seems to do exactly what I asked in FF3
and IE7. It fails in IE6 (top element disappears off top of screen
when clicking "make fifth element visible"), but I mentioned that I
don't care about IE6. Terrific!

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Oct 2 '08 #9
On 2008-10-01, dorayme <do************@optusnet.com.auwrote:
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
>On 2008-10-01, dorayme <do************@optusnet.com.auwrote:
>>
By the way, the first thought that struck me in looking at OP's problem
was that he could have made fixed work (at least on FF and Safari) by
attending to backgrounds:

<http://dorayme.890m.com/alt/positionFixed.html>

Yes that works too, and means you get to scroll the main "frame" with
the proper viewport scrollbar. But quite jerky in Firefox because their
implementation of position: fixed is crap.

I had heard of this jerkiness and have raised it myself at times but I
notice not a trace of such jerkiness in my Mac FF3 with the above URL
(nor in any other of my browsers. But I have not tested on Windows).

Now, I am talking simple scrollbar with mouse, not scroll wheels
I get the jerkiness even with the normal scrollbar, or just pressing the
down arrow (FF3 on GNU/Linux). It may be that you just have a faster
computer. Also Darwin may be more efficient at updating the screen than
Xorg.
Oct 2 '08 #10

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

Similar topics

1
by: TPG | last post by:
I'd like a Javascript function I have written to be invoked whenever *any* new document is been loaded into a particular frame (i.e I don't control the incoming document's BODY tag). Under...
2
by: Paul | last post by:
I have a simple frame-based application where title information appears in a top frame and a lower frame contains the content for the application. One of the needs for this app is for a status...
2
by: Matt | last post by:
In the following code, page1.asp is inside the frame of main.html. When the user click submit button in page1.asp, it will submit the form and open a new window called page2.asp. When the user...
4
by: Don | last post by:
Is there some way to redirect the "main" frame to another URL from within the "header" frame? Thanks, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----...
5
by: AES/newspost | last post by:
I've just re-scanned most of the 60+ posts in the "Frames are Evil" thread, and my question, as the admittedly and permanently amateur creator and maintainer of a simple site, is: Using only...
2
by: Bill Cohagan | last post by:
I'm trying out ASP.Net and am currently trying to figure out how to refresh the contents of one frame based on a button click in another frame. The button in question is actually a server side...
21
by: Steven T. Hatton | last post by:
I'm trying to improve my formal understanding of C++. One significant part of that effort involves clarifying my understanding of the vocabulary used to describe the language. This is from the...
4
by: sid | last post by:
"about:blank" oepns new browser window I am writing a webpage that will run on other machines that I may or may not know about. My page is framed where frame1 controls the content of frame2. ...
0
by: qpoi11 | last post by:
Does anyone know how to open a table in datasheet view and have the surrounding window be fitted to the table? In other words, I'd like the "frame" window surrounding the table to be fitted to the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.