css fixed position and scrolling, centering tables

S

steffen.mazanek

Hello again,

I have tried very hard to center a table and still
stay xhtml conform. But without success. How do
you reach this? The attribute align="center" is not
xhtml and margin:auto did not center my table.
Any hints are appreciated.
Another problem. Since I use css fixed position I can
not scroll any more. This is really annoying. What
can I do against this?
My page is located at www.steffen-mazanek.de,
the problem occurs at http://www.steffen-mazanek.de/de/haskell.html.

Thank you.
Ciao,
Steffen
 
T

Toby A Inkster

steffen.mazanek said:
Another problem. Since I use css fixed position I can
not scroll any more.

That is kind of the *point* of position:fixed. If you set position:fixed,
then the position of the element is fixed -- it won't move.
This is really annoying. What can I do against this?

Don't use position:fixed. Try position:absolute instead.

It is a long time since I did any programming in Haskell. Even longer
since I did any reading in German. But from what I can make out, your XML
processing with Haskell looks interesting. Haskell would really be quite a
natural language to use for XML processing.
 
S

Steve Pugh

I have tried very hard to center a table and still
stay xhtml conform. But without success. How do
you reach this? The attribute align="center" is not
xhtml

Yes it is.
It's in XHTML 1.0 Transitional just the same as it's in HTML 4.01
Transitional.
It is not in XHTML 1.0 Strict just the same as it's not in HTML 4.01
Strict.

This is not an XHTML vs HTML issue. It is a strict vs transitional, or
strurctural vs presentational issue.
and margin:auto did not center my table.

It depends on your browser and doctype. It won't work in IE up to 5.5,
or IE 6 if your doctype triggers quirks mode. It will work in IE6 in
standards mode and in most other modern browsers.

margin: 0 auto; is slightly preferred even if in most cases a value of
auto for top and bottom margins should be the same as a value of zero.
Another problem. Since I use css fixed position I can
not scroll any more. This is really annoying. What
can I do against this?

Then don't use position: fixed. By definition position: fixed; removes
the elements in question from any calculation of whether scrolling
occurs.

There's nothing on that page with a class="center", which is the only
style you have with margin: auto;, so obviously nothing will be
centered.

Steve
 
S

steffen.mazanek

Hello.

Ok, now I have just the navigation menues as position: fixed and the
content as position:absolute and I still can not scroll :-(

#navigation {
position: fixed;
top: 0; left: 0; right: 0; height: 2em;
padding: 5px 5px 5px;
text-align: center;
}
#specmenu {
position: fixed;
top: 2.1em; left: 0; bottom: 1.6em; right: 85%;
}
#speccontent {
position: absolute;
top: 2.1em; right: 0; bottom: 1.6em; left:15%;
overflow: auto;
padding: 0 1em;
}
#content {
position: absolute;
top: 2.1em; bottom: 1.6em; left: 0; right: 0;
overflow: auto;
padding: 0 0.5em;
}

I think, I need position:fixed for the menues.
It is a long time since I did any programming in Haskell.

:) Time for a restart I would say.
Even longer
since I did any reading in German. But from what I can make out, your XML
processing with Haskell looks interesting. Haskell would really be quite a
natural language to use for XML processing.

Yes, it is fun :)

Ciao,
Steffen
 
S

steffen.mazanek

Hello.

Steve Pugh said:
Yes it is.
It's in XHTML 1.0 Transitional just the same as it's in HTML 4.01
Transitional.
It is not in XHTML 1.0 Strict just the same as it's not in HTML 4.01
Strict.
Hmm.

This is not an XHTML vs HTML issue. It is a strict vs transitional, or
strurctural vs presentational issue.

I begin to understand the differences.
Then don't use position: fixed. By definition position: fixed; removes
the elements in question from any calculation of whether scrolling
occurs.

How can I allow the divs content and speccontent for scrolling and
still have the menues at fixed positions?
There's nothing on that page with a class="center", which is the only
style you have with margin: auto;, so obviously nothing will be
centered.

Oh, sorry for the confusion. This page is just an example for
scrolling.


Regards,
Steffen
 
S

steffen.mazanek

Oh, by the way, parts of the site are translated already, try the
"English" menu item :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top