Hi,

Safari is actually computing it correctly according to the CSS2
specification. You can see the relevant section at:
http://www.w3.org/TR/CSS21/visudet.html#Computing_widths_and_margins

To get the result you expect (and which most browser seem to
implement) you can set the display property to 'inline-block'.
Alternatively you could float the element or find some other way of
"wrapping" the container around its child elements.

I've written a short note on this on my layout jQuery plugin page
(http://www.bramstein.com/projects/jlayout/jquery-plugin.html ---
halfway down the page) which suffered from the same "problem" in
Safari. Setting the display property to "inline-block" fixed it. I
haven't tested your case as I am at work at the moment, but I think it
is the same issue.

Best,

Bram

On Nov 24, 12:20 pm, Paul Bakaus <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> we're facing a specific issue in jQuery UI, which has been reported by
> a couple of users, and I debugged it to find out it's specifically
> related to webkit:
>
> If a non-floating element has a margin or margin-right value set via
> stylesheets, this value is ignored in the computed style ($().css
> ('marginRight')), and instead, the offset between the element and it's
> (offset) parent to the right is returned.
>
> It's a major bug, and causes issues everywhere we're using marginRight
> (for example, the containment option in Draggables). Is this something
> we should build a workaround for, and is there really a possibility
> for a workaround, other than parsing the stylesheets by hand?
>
> In case you're wondering, here's how to easily reproduce it: Paste the
> following into a HTML file:
>
> <style>
>         .test {
>                 width:100px;
>                 height:100px;
>                 background-color:green;
>                 margin: 5px;
>                 margin-right: 5px;
>         }
> </style>
> <div class='test'></div>
>
> now type $('.test').css('marginRight') into the console.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to