By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,738 Members | 1,080 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,738 IT Pros & Developers. It's quick & easy.

How to fix elements in IE

P: n/a
Hi there,

please check out this page:

http://nadine-timo.de/hsm/index.html

In most browsers the menu and the top line are _fixed_. Who knows how to
tell Internet Explorer to do so?

Thanks in advance
Marco
--
Please change the subject to "NEWSMAIL" in your emails.
Jul 20 '05 #1
Share this Question
Share on Google+
30 Replies


P: n/a
On Mon, 24 May 2004 01:05:52 +0200, M. Ney wrote:
http://nadine-timo.de/hsm/index.html

In most browsers the menu and the top line are _fixed_. Who knows how to
tell Internet Explorer to do so?


I think the 'problem' is this line..
#kopfzeile {
position:fixed;

IE does not recognise 'position: fixed', AFAIU.
(and the problem is IE, not the style)

BTW ..be a nice chap and define an alt
tag for the image on line 66, eh?
(Even if simply alt="")

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #2

P: n/a
Andrew Thompson <Se********@www.invalid> wrote:
IE does not recognise 'position: fixed', AFAIU.
(and the problem is IE, not the style)
I know, but how to react?
BTW ..be a nice chap and define an alt
tag for the image on line 66, eh?
(Even if simply alt="")


I'll fix that before the site goes official.
--
Please change the subject to "NEWSMAIL" in your emails.
Jul 20 '05 #3

P: n/a
On Mon, 24 May 2004 08:16:38 +0200, M. Ney <m.***@gmx.net> wrote:
Andrew Thompson <Se********@www.invalid> wrote:
IE does not recognise 'position: fixed', AFAIU.
(and the problem is IE, not the style)


I know, but how to react?


There's only one way to achieve the "fixed" rendering in IE, and it
involves the optional Javascript. It's not reliable for all users, most
notably Google, so ultimately you're stuck.

Design the page so that it degrades in IE in an acceptable fashion.
Jul 20 '05 #4

P: n/a
m.***@gmx.net (M. Ney) wrote:
Hi there,

please check out this page:

http://nadine-timo.de/hsm/index.html

In most browsers the menu and the top line are _fixed_. Who knows how to
tell Internet Explorer to do so?


Not without javascript. Simple scrolltop kind of thing with callback
polling. You'd set offsets for the top bar and your nav menu. It would
work fine, automatically. The rest would 'flow underneath' and not
even know the two blocks are there. Depending on what you have on
site, a simple horizontal line menu might be preferable, as well as a
much smaller title block - but . . But IE does NOT support FIXED, as
far as I know.
Jul 20 '05 #5

P: n/a
Neal <ne*****@yahoo.com> wrote:
There's only one way to achieve the "fixed" rendering in IE, and it
involves the optional Javascript. It's not reliable for all users, most
notably Google, so ultimately you're stuck.


Since when does Google care about the usage of js for presentational
effects?

--
Spartanicus
Jul 20 '05 #6

P: n/a
M. Ney wrote:
Andrew Thompson <Se********@www.invalid> wrote:
IE does not recognise 'position: fixed', AFAIU. (and the problem is
IE, not the style)


I know, but how to react?


Use parsing bugs in browsers to protect them.
/* the following is understood by Moz, O, IE5+, Safari, etc */
..myelement { position: absolute; }

/* fix for IE, which cannot parse child selector with no spaces */
/* this is understood by Moz, O, Safari, and others */
html>body .myelement { position: fixed; }

If you have links in the fixed part, then you should probably hide it
from IE5/Mac, too. It can fix elements, but the cursor does not change
on :link:hover for links inside a fixed section.

@media screen { /* hide from IE 5 Mac using media rule */
HTML>BODY .myelement { /* hide from IE Win as above */
position: fixed;
}
}
HTH
--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #7

P: n/a
On Mon, 24 May 2004 09:07:31 +0100, Spartanicus <me@privacy.net> wrote:
Neal <ne*****@yahoo.com> wrote:
There's only one way to achieve the "fixed" rendering in IE, and it
involves the optional Javascript. It's not reliable for all users, most
notably Google, so ultimately you're stuck.


Since when does Google care about the usage of js for presentational
effects?

You are correct - but nonetheless it's a good habit to avoid Js unless you
are positive it will not interfere with page use. Google wouldn't be
bothered by this usage, but the next time... Call it an error of caution.
Jul 20 '05 #8

P: n/a
Neal <ne*****@yahoo.com> wrote:
There's only one way to achieve the "fixed" rendering in IE, and it
involves the optional Javascript. It's not reliable for all users, most
notably Google, so ultimately you're stuck.


Since when does Google care about the usage of js for presentational
effects?


You are correct - but nonetheless it's a good habit to avoid Js unless you
are positive it will not interfere with page use. Google wouldn't be
bothered by this usage, but the next time... Call it an error of caution.


Most of us have no difficulty understanding the way javascript should be
used without the need to refer to it as if it was some magical monster
that can leap at you from the dark.

--
Spartanicus
Jul 20 '05 #9

P: n/a
Brian <us*****@julietremblay.com.invalid> wrote:
M. Ney wrote:
Andrew Thompson <Se********@www.invalid> wrote:
IE does not recognise 'position: fixed', AFAIU. (and the problem is
IE, not the style)
I know, but how to react?
Use parsing bugs in browsers to protect them. If you have links in the fixed part, then you should probably hide it
from IE5/Mac, too. It can fix elements, but the cursor does not change
on :link:hover for links inside a fixed section.


After downloading Firefox 0.8, I see that the rendering differences
between mozilla and IE are SO great, that it further justifies my
approach of routing different browsers to entirely different style
sheets.

Jul 20 '05 #10

P: n/a
Ok,

I may use Javascript, it will work fine.

But if a user switches JS off for security reasons, my page design will
be killed!
--
Please change the subject to "NEWSMAIL" in your emails.
Jul 20 '05 #11

P: n/a
> http://nadine-timo.de/hsm/index.html

My brother destroyed the Link by accident.

It should work within the next hour!
--
Please change the subject to "NEWSMAIL" in your emails.
Jul 20 '05 #12

P: n/a
m.***@gmx.net (M. Ney) wrote:
Ok,

I may use Javascript, it will work fine.
What will work fine? (hint: quote)
But if a user switches JS off for security reasons, my page design will
be killed!


(after having read back in the thread due to missing quotes)

1) My remark to Neal should not be read as endorsement for this
particular usage, it merely addressed a flaw in his statement regarding
javascript usage.

2) Usage of position:fixed and a js hack to achieve the same effect in
IE is no reason why the display should be messed up if js is not enabled
(hint: code a fallback to position:absolute).

--
Spartanicus
Jul 20 '05 #13

P: n/a
On Mon, 24 May 2004 23:52:14 +0100, Spartanicus wrote:

( ..position:fixed -> IE/JS -> IE/position:absolute )
2) Usage of position:fixed and a js hack to achieve the same effect in
IE is no reason why the display should be messed up if js is not enabled
(hint: code a fallback to position:absolute).


Great idea! I might play with that
concept soon if I get a free moment..

[ I have always liked the 'fixed'
positioning but held back because
of IE's deficencies.. ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #14

P: n/a
On Tue, 25 May 2004 01:14:19 GMT, Andrew Thompson <Se********@www.invalid>
wrote:
[ I have always liked the 'fixed'
positioning but held back because
of IE's deficencies.. ]


Be aware that one of the pitfalls of fixed is that if the element has any
appreciable height, the content may be lost at some viewport sizes. I used
to like fixed, but the possibility of having content lost - especially as
the most likely candidate for fixed is a navigation division - cured me
quick.
Jul 20 '05 #15

P: n/a
On Mon, 24 May 2004 23:28:18 -0400, Neal wrote:
On Tue, 25 May 2004 01:14:19 GMT, Andrew Thompson wrote:
[ I have always liked the 'fixed' positioning
... Be aware that one of the pitfalls of fixed is that if the element has any
appreciable height, the content may be lost at some viewport sizes.


Lose my content?! Definitely something
that would require investigation.

I like 'squeezy' pages where possible,
and like them to be useable if the visitor
can only give my page half the screen width.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #16

P: n/a
On Tue, 25 May 2004 03:36:40 GMT, Andrew Thompson <Se********@www.invalid>
wrote:
Lose my content?! Definitely something
that would require investigation.

I like 'squeezy' pages where possible,
and like them to be useable if the visitor
can only give my page half the screen width.


It's the width AND the height. Width will wrap. Height cannot.
Jul 20 '05 #17

P: n/a
Andrew Thompson <Se********@www.invalid> wrote:
I like 'squeezy' pages where possible,
and like them to be useable if the visitor
can only give my page half the screen width.


But as I wrote, before, why not just line menus, which are so common,
now? Just keep a line menu at the top, centered. If the jscript is
off, no big deal. Your viewer will have to use the sliders, the
scrollbars, to get back to the nav at the top. That's their choice.
That's how they want it.

Jul 20 '05 #18

P: n/a
M. Ney wrote:
Hi there,

please check out this page:
http://nadine-timo.de/hsm/index.html

In most browsers the menu and the top line are _fixed_. Who knows how
to tell Internet Explorer to do so?


It is certainly possible, in some cases, to get the effect of { position:
fixed } in IE without using Javascript. I got help elsewhere and also used
information at the following page:
http://devnull.tagsoup.com/fixed/

Here are a couple of experiments I did. (Valid HTML 4.01 Strict).

In this case, the boxes you see are actually the cells of a table. The CSS
takes the table apart & sticks the cells to the sides of the viewport.
http://www.barry.pearson.name/articl.../exhibit05.htm

In this case, there are sidebars that remain fixed, *but* not in versions of
IE before IE 6. (I haven't yet managed to do it in earlier versions).
http://www.barry.pearson.name/articl.../fixed_bar.htm

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #19

P: n/a
"Barry Pearson" <ne**@childsupportanalysis.co.uk> wrote:
In this case, the boxes you see are actually the cells of a table. The CSS
takes the table apart & sticks the cells to the sides of the viewport.
http://www.barry.pearson.name/articl.../exhibit05.htm

In this case, there are sidebars that remain fixed, *but* not in versions of
IE before IE 6. (I haven't yet managed to do it in earlier versions).
http://www.barry.pearson.name/articl.../fixed_bar.htm


Is there a net advantage, however, to this over a simple 10-line
javascript callback which would work in all versions of IE, and other
browsers? In addition, doesn't it thrown things off to set HTML and
BODY in this way?

Jul 20 '05 #20

P: n/a

"M. Ney" <m.***@gmx.net> wrote in message
news:1ge9m7q.19l7g4k1b60w64N%m.***@gmx.net...
Hi there,

please check out this page:

http://nadine-timo.de/hsm/index.html

In most browsers the menu and the top line are _fixed_. Who knows how to
tell Internet Explorer to do so?
Try setting position: absolute
then define top and left px coordinates for the top left corner of the
object whose position you wish to fix.

You may also have to define positioning and occasionally size in some other
objects as well...

=~=
Timothy Casey
South Australia
wo****@iprimus.com.au

Formerly:
ca***@smart.net.au

Phenomenal Speed Comprehension:
Discover the World's most advanced speed reading application at:
http://www.fieldcraft.biz/shop/


Thanks in advance
Marco
--
Please change the subject to "NEWSMAIL" in your emails.

Jul 20 '05 #21

P: n/a
Mark Johnson wrote:
"Barry Pearson" <ne**@childsupportanalysis.co.uk> wrote:
In this case, the boxes you see are actually the cells of a table.
The CSS takes the table apart & sticks the cells to the sides of the
viewport.
http://www.barry.pearson.name/articl.../exhibit05.htm

In this case, there are sidebars that remain fixed, *but* not in
versions of IE before IE 6. (I haven't yet managed to do it in
earlier versions).
http://www.barry.pearson.name/articl.../fixed_bar.htm
Is there a net advantage, however, to this over a simple 10-line
javascript callback which would work in all versions of IE, and other
browsers?


I can't make a decision for anyone else. Without a pure-CSS method that works
for IE 5, I would probably go for the Javascript. But with such a pure-CSS
method, I would probably go for it, if only because the user is more likely to
have CSS than Javascript.
In addition, doesn't it thrown things off to set HTML and
BODY in this way?


Ask me next year! I'm currently trying to understand the implications of such
html & body rules. It isn't simply what they *do*. I am struggling to
understand what they *mean*. I'm unclear when you should use one and when the
other.

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #22

P: n/a
Spartanicus wrote:
m.***@gmx.net (M. Ney) wrote:
I may use Javascript, it will work fine.
What will work fine? (hint: quote)


The site will work fine. (hint: if there's nothing to quote, don't do.)

Just read the subject of this thread!
(after having read back in the thread due to missing quotes)


Many people will remember what a discussion is about, some will have to
read twice..

Marco
..

--
Please change the subject to "NEWSMAIL" in your emails.
Jul 20 '05 #23

P: n/a
Timothy Casey wrote:
Try setting position: absolute
then define top and left px coordinates for the top left corner of the
object whose position you wish to fix.


That's what I did! I defined top and left with either pos:fixed or
absolute. It didn't work..

I will test that another time.

Thanks
Marco
--
Please change the subject to "NEWSMAIL" in your emails.
Jul 20 '05 #24

P: n/a
Spartanicus wrote:
What will work fine? (hint: quote)
M. Ney <m.***@gmx.net> wrote:
The site will work fine. (hint: if there's nothing to quote, don't do.)
What site?
Just read the subject of this thread!
So someone appears to be trying to fix elements in a way that MSIE actually
supports. But what technique works? And what technique(s) didn't work?
(after having read back in the thread due to missing quotes)

Many people will remember what a discussion is about, some will have to
read twice..


And many people will come upon your context-free post first, and will have
no idea what you're talking about. The other messages in the thread may not
be on the server. Or the newsreader may not present the messages as a
thread.

Many people will not have read the previous posts. I certainly don't read
everything posted to the comp.infosystems.www.authoring.* groups. The
killfile is your friend, and all that.
--
Darin McGrew, da***@TheRallyeClub.org, http://www.TheRallyeClub.org/
A gimmick car rallye is not a race, but a fun puzzle testing your
ability to follow instructions. Upcoming gimmick car rallye in
Silicon Valley: Best in Show (Saturday, June 5)
Jul 20 '05 #25

P: n/a
M. Ney wrote:
Many people will remember what a discussion is about, some will have to
read twice..


And many people contribute to many, many discussions. Sometimes hundreds
a day.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Jul 20 '05 #26

P: n/a
M. Ney wrote:
Ok,

I may use Javascript, it will work fine.

But if a user switches JS off for security reasons, my page design will
be killed!


Then in the sense of the World Wide Web, your Javascript and your page
design do *not* work.

Actually, security reasons are not the only reason to switch off Javascript
(limiting CPU usage is another reason that comes to mind).

--
Shawn K. Quinn
Jul 20 '05 #27

P: n/a
Shawn K. Quinn wrote:
M. Ney wrote:
I may use Javascript, it will work fine.

But if a user switches JS off for security reasons, my page design will
be killed!


Then in the sense of the World Wide Web, your Javascript and your page
design do *not* work.

Actually, security reasons are not the only reason to switch off Javascript
(limiting CPU usage is another reason that comes to mind).


So the situation is like this:

- Frames have many disadvantages, as listed in this document from 1996:

Why frames suck, http://www.useit.com/alertbox/9612.html

- CSS shows compatibility issues, especially in IE and Netscape/Mozilla

- Javascript isn't activated on every single browser

So what conclusions should be drawn? If you want to have a fixed menu
when the reader scrolls, what should you do?

Ciao
Marco
--
Please change the subject to "NEWSMAIL" in your emails.
Jul 20 '05 #28

P: n/a
M. Ney wrote in
<1g*************************@gmx.net>
Shawn K. Quinn wrote:
M. Ney wrote:
I may use Javascript, it will work fine.

But if a user switches JS off for security reasons, my page design
will be killed!


Then in the sense of the World Wide Web, your Javascript and your
page design do *not* work.

Actually, security reasons are not the only reason to switch off
Javascript (limiting CPU usage is another reason that comes to mind).


So the situation is like this:

- Frames have many disadvantages, as listed in this document from
1996:

Why frames suck, http://www.useit.com/alertbox/9612.html

- CSS shows compatibility issues, especially in IE and
Netscape/Mozilla

- Javascript isn't activated on every single browser

So what conclusions should be drawn? If you want to have a fixed menu
when the reader scrolls, what should you do?


Without being facetious, you could stop wanting to have that feature.

Whilst it may well be an attractive and functional feature of your design,
and one that is hard to abandon after you've worked on it for so long, there
are millions of effective pages out there that get by without it.

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Jul 20 '05 #29

P: n/a
On Thu, 3 Jun 2004 16:35:06 +0200, M. Ney <m.***@gmx.net> wrote:
If you want to have a fixed menu
when the reader scrolls, what should you do?


Set it up so the div functions as absolute on IE and fixed on supporting
browsers. If the UA cannot support fixed, it will still work, although not
as desired.
Jul 20 '05 #30

P: n/a
M. Ney wrote:
If you want to have a fixed menu when the reader scrolls, what
should you do?


Stop wanting that, at least as a requirement of the design. In
general, when writing web documents, you'll be more successful if you
can let go of the presentation a bit.

--
Brian (remove ".invalid" to email me)

Jul 20 '05 #31

This discussion thread is closed

Replies have been disabled for this discussion.