Bug Tracker

Opened 5 years ago

Closed 5 years ago

#9839 closed bug (invalid)

Returning an empty string when using .css('border')

Reported by: edmandie.samonte@… Owned by:
Priority: low Milestone: 1.next
Component: css Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


Here is the code I used

<script type="text/javascript">
           $('h1').css({'border':'1px solid #ccc'});
<h1>Some Message</h1>

And the output using alert or using firebug is: (an empty string)

In IE9 border-width is detected and not the whole border property.

Change History (1)

comment:1 Changed 5 years ago by rwaldron

  • Component changed from unfiled to css
  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed

According to: http://api.jquery.com/css ....

Shorthand CSS properties (e.g. margin, background, border) are not supported. For example, if you want to retrieve the rendered margin, use: $(elem).css('marginTop') and $(elem).css('marginRight'), and so on.

Note: See TracTickets for help on using tickets.