473,327 Members | 2,090 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,327 software developers and data experts.

Absolute positioning and margins

Hello.

Should /margin/ properties take effect on absolutely-positioned blocks?
I thought not, but the referred sample HTML [1] seems to prove me wrong
both on IE 6.0 and Firefox 0.8. I thought the /margin/ property should
have no effect, since the location of the positioned block is being
controlled by the /top/, /left/, etc. properties. The CSS2 Specification
states:

"Positioned elements generate positioned boxes, laid out according to
four properties: [top, right, bottom, left]"

There is no mention of /margin/. So, if I intend to have a block at (0,
0), I should only have to set /top/ and /left/ to 0 and not be concerned
about setting /margin-top/ and /margin-left/ to 0 as well.

Does anybody see something in the text of the Specification which I may
have missed?

[1] http://undl.org.br/temp/absmarg.html

Thank you,

--
Ney André de Mello Zunino
Jul 20 '05 #1
2 1776
Ney André de Mello Zunino wrote:
Should /margin/ properties take effect on absolutely-positioned blocks?
Yes.
I thought not, but the referred sample HTML [1] seems to prove me wrong
both on IE 6.0 and Firefox 0.8. There is no mention of /margin/ [in spec].
Not in that place. Read whole spec sometime, it has lots you have missed.
So, if I intend to have a block at (0,
0), I should only have to set /top/ and /left/ to 0 and not be concerned
about setting /margin-top/ and /margin-left/ to 0 as well. Does anybody see something in the text of the Specification which I may
have missed?


This, for example.
http://www.w3.org/TR/CSS21/visudet.h...replaced-width

Especially the blockquote in the middle of that section. I wonder where
they quoted it...
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
I'm looking for work | Etsin työtä
Jul 20 '05 #2
Ney André de Mello Zunino wrote:
Hello.

Should /margin/ properties take effect on absolutely-positioned blocks?
I thought not, but the referred sample HTML [1] seems to prove me wrong
both on IE 6.0 and Firefox 0.8. I thought the /margin/ property should
have no effect, since the location of the positioned block is being
controlled by the /top/, /left/, etc. properties. The CSS2 Specification
states:

"Positioned elements generate positioned boxes, laid out according to
four properties: [top, right, bottom, left]"

There is no mention of /margin/. So, if I intend to have a block at (0,
0), I should only have to set /top/ and /left/ to 0 and not be concerned
about setting /margin-top/ and /margin-left/ to 0 as well.

Does anybody see something in the text of the Specification which I may
have missed?

[1] http://undl.org.br/temp/absmarg.html

Thank you,


http://www.w3.org/TR/CSS21/box.html#box-dimensions
*Each box has* a content area (e.g., text, an image, etc.) and optional
surrounding *padding, border, and margin* areas; ......

--
Gus
Jul 20 '05 #3

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

Similar topics

12
by: Tom Szabo | last post by:
Hi, Just wondering if there are any disadvantage in absolute positioning controls on a page? In example instead of putting the text fields into a table to align properly, one would absolute...
5
by: Duane Lambe | last post by:
On some suggestions from this group, I've started to turn my internal helpdesky site for our company to non-absolute positioning. I've been reading O'Reilly's CSS book, and several web sites and...
16
by: Vincent | last post by:
First, here is a page to help you figure out what I'm talking about: http://relinquiere.free.fr/test.html As you can see in the source of this page, the structure is the following : - a banner...
28
by: jonjon | last post by:
Hi, I want to be able to define the right property of my absolute positionned elements... for example if a button is 50px left and 150px right, it will resize when the page is resized. This is...
8
by: Bryan R. Meyer | last post by:
Hello Everyone, I am in the process of redesigning my web page and I ran into a problem while using CSS. I have laid out my web page with auto margins so that the content is centered. I assume...
7
by: qwerty | last post by:
Following works in Mozilla, Opera and IE. <div style=" left: 100px; right: 200px; /* JavaScript-hack for IE*/ width: expression((document.body.clientWidth - 100 - 200) + 'px') ">...
3
by: Greg G | last post by:
We have a band web site. Here's the site now: http://www.risky-biz.com The home page has a "collage" of photos of the members of the band. The collage is actually one .gif image that I put...
4
by: mike eli | last post by:
Hi, I have several absolute positioned elements inside an absolute positioned DIV. I would like one of the nested elements to have a dynamic width. I set it's left and right attributes to 5, so...
4
by: Alan Silver | last post by:
Hello, Having been a light reader of this ng for a few months now (after several years absence), I have noticed that absolute positioning seems to be considered a Very Bad Thing around here....
14
by: Fistro | last post by:
I'm trying to find a design that would allow me to build web pages without having to worry about compatibility issues (not too much, in any case,,,) I've came across this CSS layout technique:...
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: 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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.