Why doesn't this container center?

N

Nik Coughlin

richard said:
Now why do I use inches instead of pixels or ems?
When you buy space for an ad in a newspaper do they sell that space by
pixels or ems? No they do not. They sell by inches. Then worry about
what can fit, and how it will fit, into that space.

Protip: the web is a fluid medium, print is fixed.
A boundary defined in inches will always be displayed exactly the same
regardless of the screen resolution.
False

http://www.emdpi.com/cssinch.html

I am well aware that there are
those here who will take that presentation to the extreme and see at
what point it fails. While 95% or more of general users never bother
considering changing the text size.

It is irrelevant whether or not the user changes their text size. The
default text size can vary between OS and browser, and additionally, if the
font specified by the page author is not available another font will be
substituted, which may have a different x-height.
The size of a pixel or em is a variable, an inch is a constant.

The CSS inch is a logical inch, not a physical inch.
 
R

rf

richard said:
Well I am totally convinced that most people who post to this group
have no brains, let alone clues, on how to change things to their
liking.

ROFL. Pot. Kettle.
Now why do I use inches instead of pixels or ems?
When you buy space for an ad in a newspaper do they sell that space by
pixels or ems? No they do not. They sell by inches. Then worry about
what can fit, and how it will fit, into that space.

You are deluded if you think that authoring for the web has anything at all
to do with ads in newspapers.

However, I'll bite.

That yellow square is, on one of my monitors, two and a quarter inches big.

On another one of my monitors it's two and three quarter inches big.

On another one of my monitors it's one and a half inches big.

When I indulge in zoom in IE7 it's variable, depending on how much and in
which direction I spin my mouse wheel.

On my data projector it's one and a half *feet* big.

Inches on the web is a meaningless unit.
A boundary defined in inches will always be displayed exactly the same
regardless of the screen resolution.

No, it won't. See above. Did you actually try it. Did you look at that code
with a browser and measure the size of the box with a rule? If you did and
got two inches than you have come across one incredible coincidence.
I am well aware that there are
those here who will take that presentation to the extreme and see at
what point it fails. While 95% or more of general users never bother
considering changing the text size.

What does the size of a div have to do with text size if you specify its
size in inches? Nothing at all.
The size of a pixel or em is a variable, an inch is a constant.

No, it is not a constant. It depends on the size of the monitor, how many
pixels it has and finally on the guesswork indulged in by the browser on how
to convert inches to pixels, because ultimately everything on a computer
monitor is layed out in pixels.
 
D

dorayme

"rf said:
It's not an instruction. It's a property/value pair.

To be fair to Richard, these two things are not incompatible. The
reference is the same one thing, the meaning of the two expressions are
different. Describing it as an instruction is deep and refers to its
causal power. Never criticize a truck driver when he is being deep.
 
D

dorayme

John Hosking said:
All of the above, plus the weird "Created on: 2/26/2009", the orphaned
background color, and what seemed a deliberate unwillingness to use the
OP's content as a starting point for comparison or elucidation.
Richard's post seemed to show a single-minded determination to provide
something as *different* from what the OP wanted or needed as possible.

All of the above heaped on a dirty plate which is dropped on the table
in front of the customer, while the waiter grunts a surly, "try this
version," by way of provocative explanation for serving salisbury steak
instead of the T-bone and baked potato the customer was expecting.

I don't usually do lunch, but this is making me peckish...
 
D

dorayme

"Nik Coughlin said:
The CSS inch is a logical inch, not a physical inch.

mmm... that's an interesting concept!

I think of an inch as a physical measurement. If a screen does not obey
the CSS, the screen is a dirty low-down no-good lying sob sod and it is
not the CSS's fault. It meant *physical inches*.

The responsibility to follow a CSS instruction is left to things outside
the CSS. I have personally witnessed a CSS sheet groaning at the use it
is sometimes put to. <g>
 
R

rf

dorayme said:
To be fair to Richard, these two things are not incompatible. The
reference is the same one thing, the meaning of the two expressions
are different. Describing it as an instruction is deep and refers to
its causal power. Never criticize a truck driver when he is being
deep.

So, can I call the following javascript fragment

var i = 1;

a property/value pair or should I call it an instruction, or should I call
it, er, a statement?

Some common misnamings:

element -> tag
element name -> tag
attribute -> tag
attribute value -> tag
character reference -> tag
CSS rule -> tag
selector -> tag
property -> tag
property value -> tag

tag -> command
 
R

richard

All of the above, plus the weird "Created on: 2/26/2009", the orphaned
background color, and what seemed a deliberate unwillingness to use the
OP's content as a starting point for comparison or elucidation.
Richard's post seemed to show a single-minded determination to provide
something as *different* from what the OP wanted or needed as possible.

All of the above heaped on a dirty plate which is dropped on the table
in front of the customer, while the waiter grunts a surly, "try this
version," by way of provocative explanation for serving salisbury steak
instead of the T-bone and baked potato the customer was expecting.

Oh great ceasear's ghost.
Nit pickin to the damnest extremes.
The question was basically how to center a division.
Content can be defined by the poster at will.

The date thing I didn't bother to delete as I did other items.
Which is totaly a decision to be made by the user and not a
requirement of standards.

The real truth is, you're pissed because **I** presented the solution
before YOU did.
 
D

dorayme

"rf said:
So, can I call the following javascript fragment
var i = 1;
a property/value pair or should I call it an instruction, or should I call
it, er, a statement?

Depends on the context and the audience. Statement is fine by me.

The idea of "instruction" in relation to CSS is simply that it is
"something a browser will respond to"

I realise you are conscious of the programming context and that this is
misleading or seems to harbour a misunderstanding. But, to be fair to
Richard, he is into RunBasic and knows about all this stuff, I say, give
him the benefit of the doubt on this.
 
R

richard

Protip: the web is a fluid medium, print is fixed.


It is irrelevant whether or not the user changes their text size. The
default text size can vary between OS and browser, and additionally, if the
font specified by the page author is not available another font will be
substituted, which may have a different x-height.


The CSS inch is a logical inch, not a physical inch.

Still, I find using inches easier than pixels.
Pixels are purely in reference to a screen output.
So why are we then given options to use variables that are designed
purely for the print media?
Flexibillity perhaps?
Then what if the user decides to print the page? Will the inches be
physical inches or logical inches?

Now let's put this puppy to bed and move on.
 
R

rf

richard said:
Oh great ceasear's ghost.
Nit pickin to the damnest extremes.
The question was basically how to center a division.

And the answer was to add a : after that margin property.
The real truth is, you're pissed because **I** presented the solution
before YOU did.

The correct answer was presented three hours before you chimed in with
something that basically duplicated what the OP had and then added some
rather off tasting relish.
 
R

rf

richard said:
Still, I find using inches easier than pixels.

So why are you advising people here to use inches if it is only your ease of
use that pixels helps? The rest of us here us ems.
Pixels are purely in reference to a screen output.

Rubbish. There are pixels on a peice of paper (see below). They are however
usually called dots.
So why are we then given options to use variables that are designed
purely for the print media?

Because some joe that wrote a browser last century thought it might be a
good idea.
Flexibillity perhaps?

Stupidity perhaps?
Then what if the user decides to print the page? Will the inches be
physical inches or logical inches?

They will be physical inches because the browser knows the size of the paper
and exactly how many phsyical dots per inch the printer is running at. It
knows this because the print driver tells it. If a printer is running at
2000 DPI then two inches will be 4000 dots.

On a screen the browser does not have that information because it is simply
not available. So the browser must guess at the number of pixels per inch,
and it will invaribly get it wrong. That is what you are failing to
understand.

Print !== screen.
 
N

Nik Coughlin

richard said:
Still, I find using inches easier than pixels.
Pixels are purely in reference to a screen output.
So why are we then given options to use variables that are designed
purely for the print media?

CSS styles a document for presentation on an output device, that device is
not necessarily a screen, it may be a fixed medium such as print. In this
case, inches become useful.
 
R

rf

Ben said:
It is available. You just put this in your xorg.conf:

DisplaySize 338 270

and the browser reads it. Equivalents exist on other OSes. Not all
browsers bother, but the information is quite often there.

I didn't know that. Must be a linux thing.

Are those numbers the actual number of pixels acrross and down a square inch
of screen real estate? Why are they different, are your pixels rectangular?

How do I make this work when I have three monitors and one of them is
running a different "resolution" or pixel density? They are the same
physical size, two are 1280 pixels wide and one is 1024 pixels wide.

The real question though is, after that other Richard has specified the
dimensions of a "division" in inches can he update *your* OS with the
required info? If not then inches are not a viable unit to use for on the
web @media screen.

I do agree with the comments made elsewhere in this thread about @media
print though. Of course this too has it's hassles. A peice of paper is IIRC
a different size in the U S of A than it is in .au. We use A4. Doesn't the U
S of A use "legal" or "foolscap" or something, in line with their total
refusal to use sane measurement units like metres?
 
R

rf

Ben said:
Ben said:
[...]
On a screen the browser does not have that information because it
is simply not available.

It is available. You just put this in your xorg.conf:

DisplaySize 338 270
I didn't know that. Must be a linux thing.

Are those numbers the actual number of pixels acrross and down a

They're the width and height of the actual screen in "physical" mm.
Elsewhere you set how many pixels there are, I think I've got
1280x1024.

Ah, OK. Given that information the browser would be able to make a confident
decision.
We can work out from this that each pixel is a 0.264mm square, so
there are 96 pixels to an inch.

Yes. Even more OK.
RTFM xorg.conf :)

Doesn't help with Windows. :)

I may be in error as I have only been using activly it since version 3 back
in the last century but I have never seen such a setting. There is the
mythical "DPI" setting in the screen properties advanced dialog but this is
nothing to do with what we are talking about. Once again, it is the
*logical* dots per inch.
I hope Richard can't update my OS. But he doesn't need to: if my
browser on my OS displays inches bigger or smaller than they are then
that's my problem, not his.

Yes, *your* browser. But the point is that said Richard is assuming that
every other viewer out there has configured their xorg.conf correctly. I,
for example, have not as I don't have one.

Said Richard is making an *assumption* about the viewers environment, and we
all know that such assumptions only work untill the masses prove them wrong
:)

This is the point he does not get. A logical inch on *my* screen is not an
inch long. In some cases by a very long way.
 

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,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top