Mr. X. said:
I did something like this (in css)
#wrap
{
position: absolute;
top:0;
left:0;
Take that all out, it will not help centering anything, as it places
the div in a fixed spot. (relative to whatever element is its parent,
probably body)
850 what?
If there is any text at all inside that div, don't set a height. It
will make the text spill over the bottom border in situations beyond
your control.
This means 100% of the width of its parent. If that is the body
element, it will be very wide. No room for margins.
Only has effect is the width is less than 100%.
Why did you add that?
background-image:url('images/myimage);
You have a superfluous apostrophe there. Or a missing one, depending
on your choice
background-repeat:no-repeat;
background-size:auto;
I've never heard of background-size. Where did you find that one?
background-attachment:fixed;
This can be useful, depending on the desired result.
}
(in main html :
...
<body>
<div id = "wrap" align = "center">
Why align="center" ?
Are you trying to horizontally center the div, or its contents?
If the div: use CSS to set a width (smaller than 100%), and
margin:auto.
If the contents: use CCS - text-align:center;
...
1.
100% is 100% of the image (otherwise, as 75% : the image is cut and there is
no percents ratio).
100% of what image - the background image? Nope, that won't work. You
can't stretch a background image. The 100% you set for div#wrap, is
100% of the width of its parent element.
I have tried many variant of the CSS (like putting 75% instead of 100%,
with no position : absolute, etc ...
but margin:auto is not doing the right spaces from left & right, so the
image is not in the center) - What am I wrong ?
You can only have spaces left and right if the width is less than all
of it.
2.
Isn't there a problem of distortion of the web-site images, like stretch,
and unclear bitmaps, etc, because they are smaller ?
Depends - there is no such problem with background-images, as they
simply don't stretch.
Thanks
You're welcome.