473,322 Members | 1,699 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,322 software developers and data experts.

size independent positioning

hi all. probably a trifle put google didn't tell me much. I notice there are
size units such as 'pt' and 'px'. is there one that will position the same
regardless of browser size, screen resolution, browser type?

Thanks

Aug 15 '05 #1
4 1656
Darren wrote:
hi all. probably a trifle put google didn't tell me much. I notice
there are size units such as 'pt' and 'px'. is there one that will
position the same regardless of browser size, screen resolution,
browser type?


Basically, no.

Read http://www.w3.org/TR/CSS21/syndata.html#length-units for the
descriptions of all the different units.

In theory, if you use an absolute unit (in, cm, mm, pt or pc) it should
display the same size on all devices (although that may be a varying number
of physical pixels as resolution varies), but in practice different
browsers have different interpretations, and fixed sizes are pretty
unfriendly as far as accessibility is concerned.

Even if you think you have tied the sizes down pretty tightly (e.g. width
and font size specified in pixels) you will still find that text
displays at different sizes in different browsers and wraps differently on
different devices in the same browser.

The best thing is to make your layouts flexible so that they display well
over a wide range of conditions (and test over a wide range of systems as
well).
Aug 15 '05 #2

"Duncan Booth" <du**********@invalid.invalid> wrote in message
news:Xn*************************@127.0.0.1...
Darren wrote:
hi all. probably a trifle put google didn't tell me much. I notice
there are size units such as 'pt' and 'px'. is there one that will
position the same regardless of browser size, screen resolution,
browser type?
Basically, no.

Read http://www.w3.org/TR/CSS21/syndata.html#length-units for the
descriptions of all the different units.

In theory, if you use an absolute unit (in, cm, mm, pt or pc) it should
display the same size on all devices (although that may be a varying

number of physical pixels as resolution varies), but in practice different
browsers have different interpretations, and fixed sizes are pretty
unfriendly as far as accessibility is concerned.

Even if you think you have tied the sizes down pretty tightly (e.g. width
and font size specified in pixels) you will still find that text
displays at different sizes in different browsers and wraps differently on
different devices in the same browser.

The best thing is to make your layouts flexible so that they display well
over a wide range of conditions (and test over a wide range of systems as
well).


The problem is its like s slide out menu using two divs. when you move the
mouse over one, the other flies oout next to it but sadly it you resize the
window, screan or change the browser to one like konquerer the fly out
appears elsewhere usually above where it should. I am looking at locking the
flyout menu to the vertical position of its parent but its tricky because
its parents don't have any coords to work with.

Darren
Aug 16 '05 #3
Darren wrote:
The problem is its like s slide out menu using two divs. when you move
the mouse over one, the other flies oout next to it but sadly it you
resize the window, screan or change the browser to one like konquerer
the fly out appears elsewhere usually above where it should. I am
looking at locking the flyout menu to the vertical position of its
parent but its tricky because its parents don't have any coords to
work with.

You don't need any coordinates for that. You just need to make sure you
understand positioning. In particular, position:absolute doesn't always
mean an absolute position on the page.

Put a containing div around where your menu is to appear and give it
position:relative, but don't specify any top or left. Now put your menu
inside this div and use position:absolute on the menu. The top/left
settings for the menu are then relative to the enclosing div.
Aug 16 '05 #4

"Duncan Booth" <du**********@invalid.invalid> wrote in message
news:Xn*************************@127.0.0.1...
Darren wrote:
The problem is its like s slide out menu using two divs. when you move
the mouse over one, the other flies oout next to it but sadly it you
resize the window, screan or change the browser to one like konquerer
the fly out appears elsewhere usually above where it should. I am
looking at locking the flyout menu to the vertical position of its
parent but its tricky because its parents don't have any coords to
work with.

You don't need any coordinates for that. You just need to make sure you
understand positioning. In particular, position:absolute doesn't always
mean an absolute position on the page.

Put a containing div around where your menu is to appear and give it
position:relative, but don't specify any top or left. Now put your menu
inside this div and use position:absolute on the menu. The top/left
settings for the menu are then relative to the enclosing div.

Thanks Duncan. I had the right idea first time but had it backwards. I was
setting the inner divs as relative and the outer as absolute. I changed it
round and the problem was fixed

Best regards

Aug 16 '05 #5

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

Similar topics

2
by: Billy | last post by:
Hi, This is in connection to the tread: Re: changing browser text settings?? I am wondering if there is a way to retrieve the browsers text size (not change! ;-) ) so that I can dynamically...
0
by: Mike | last post by:
I've been working on a pop-up menu, one of those where you mouse over a button and a submenu pops up. Because the client wanted the menu centered, I gave the starting point of the submenu an...
2
by: David Winter | last post by:
This is a totally trivial CSS problem, I'm sure, but I don't get it. I want a centered DIV with a fixed width between two other DIVs that should fill the rest of the window/viewport (= 100%). How...
7
by: Andrew | last post by:
Hello, Is it possible for a file position indicator of an input stream to be greater than the size of a file? And if so could this cause fgetc to somehow write to the file? For example is it...
5
by: Joe Bonavita | last post by:
My Web forms display differently on different machine with the same resolution. The pages are designed to fit in 800*600 res but on some machines with 800*600 the form appears too big. Are there...
3
by: MG | last post by:
It appears that VS.NET limits the size of a web form to the size of your screen based on the resolution of the machine it's running on. Is there a way to make the size of a web form larger than the...
1
by: Achim Domma (SyynX Solutions GmbH) | last post by:
Hi, is there a possibility to set the font size to a percent value of the "top level" font size? For example: The font size of the body might be 100% and I have a div which should have a...
5
by: Robert | last post by:
Hi, I am currently trying to do some Javascript sizing and positioning using Javascript and encounter some for me unexpected behaviour in IE6, yet works fine in Firefox and Opera. I have a...
6
by: John | last post by:
Hi How can I develop a screen resolution independent winform app in vb.net? Do I need a third party tool to achieve this? Thanks Regards
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.