Just to be clear, w3schools.com is a training site, not to be confused with the w3c site (http://www.w3.org/).
Even on the w3schools page you reference, it says only "The border property *sets* all border properties in one declaration." (emphasis mine) The css spec (http://www.w3.org/TR/REC-CSS2/about.html#shorthand) only discusses using shorthand properties for setting multiple values at once, but as it's only talking about css (not DOM/js) the lack of "getting" discussion is not all that telling. For completeness, this topic (shorthand css properties) has come up on this list before. See: .css("border-color") returning undefined http://groups.google.com/group/jquery-en/browse_thread/thread/9fdb1c44c2d9083f element.css("background") returns undefined http://groups.google.com/group/jquery-en/browse_thread/thread/b1c863aa49ba185b Background-position related CSS properties issue http://groups.google.com/group/jquery-dev/browse_thread/thread/6e9e0ba3486aebc6 .css("border-color") problem in FireFox http://groups.google.com/group/jquery-en/browse_thread/thread/bc05e70abe3e915e How to get all CSS values from Attributes http://groups.google.com/group/jquery-en/browse_thread/thread/cab8f2d960af977f - Richard On Fri, Apr 25, 2008 at 2:34 AM, Alexandre Plennevaux <[EMAIL PROTECTED]> wrote: > hi Giuliano and thanks for holding on :-) > > I understand your point but the infos published on the W3C website seem to > mean that border as a shorthand is retrievable: > > http://www.w3schools.com/htmldom/prop_style_border.asp > > > > > On Thu, Apr 24, 2008 at 11:58 PM, Giuliano Marcangelo < > [EMAIL PROTECTED]> wrote: > >> Dear Alexandre, >> >> if we take #id{ border: 1px solid #FF0000;} , border is shorthand >> (convenience method) for border-top,border-right,border-bottom,border-left / >> width - style - color, all in all twelve combinations.........if it would >> make sense for $('#id').css('border-color'); return #FF0000........ >> >> what would be the expected returned result for the following, >> >> #id{ border: 1px solid #FF0000;} >> #id{ border-bottom-color:#FFFF00} >> >> ........????? >> >> >> >> 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: >> >>> i know all this Guiliano, and according to what i've googled about >>> javascript style.border, it can retrieve the value if that value has been >>> set before, which is the case here. >>> >>> in any case, if in the css, you 've set #id{ border: 1px solid >>> #FF0000;} then it would only make sense that $('#id').css('border-color'); >>> return #FF0000 yet it does not. If it is not a bug, it's definitely a place >>> for improvement. >>> >>> >>> >>> >>> On Thu, Apr 24, 2008 at 5:41 PM, Giuliano Marcangelo < >>> [EMAIL PROTECTED]> wrote: >>> >>>> Alexandre, >>>> >>>> to access the border properties, you have to be more specific.......... >>>> >>>> border has four sides, top - right- bottom - left >>>> . >>>> and also style, color and width properties.... >>>> >>>> so to get your required css....you need to access (as an example) >>>> >>>> border-bottom-style ..... or >>>> border-bottom-color ..... or >>>> border-bottom-width >>>> >>>> jQuery is good , but does not possess a crystal ball....... >>>> >>>> if you think about the border ( and also padding / margin) properties, >>>> each border can be a different color/width and style to each of its >>>> neighbours, so you have to be explicit in your request >>>> >>>> hope this helps :-) >>>> >>>> 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: >>>> >>>> I wonder why this doesn't work, either it's a but or a flaw in the >>>>> documentation: >>>>> >>>>> >>>>> >>>>> consider this code: >>>>> >>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " >>>>> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >>>>> <html> >>>>> <head> >>>>> <style type="text/css"> >>>>> h1 { >>>>> background-color: #FF00FF; >>>>> color: white; >>>>> border: 1px solid red; >>>>> } >>>>> </style> >>>>> <script type="text/javascript" >>>>> src="../jquery.latest.js"></script> >>>>> <script type="text/javascript"> >>>>> $(document).ready(function(){ >>>>> var mycss = $('h1').css('border'); >>>>> alert("hi : " + mycss ); >>>>> }); >>>>> >>>>> </script> >>>>> </head> >>>>> <body> >>>>> <h1>hello world</h1> >>>>> </body> >>>>> </html> >>>>> ... >>>>> >>>>> >>>>> mycss returns undefined instead of '1px solid red' >>>>> >>>>> >>>>> Unless there is a good reason that i'm unaware of, this seems like a >>>>> bug to me, no ? >>>>> >>>>> Thanks >>>>> >>>>> Alexandre >>>>> >>>> >>>> >>> >>> >>> -- >>> Alexandre Plennevaux >>> LAb[au] >>> >>> http://www.lab-au.com >> >> >> > > > -- > Alexandre Plennevaux > LAb[au] > > http://www.lab-au.com >