Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#14022 closed bug (notabug)

$(selector).css('width') returns wrong value

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:


$(selector).css('width') returns the elements actual width not it's css width property. For example

Change History (3)

comment:1 Changed 10 years ago by [email protected]


shows that it gives the actual width value in pixels of the element and not it's css property of 100% percent. The docs say that .css returns css properties not rendered sizes.

comment:2 Changed 10 years ago by markelog

Resolution: notabug
Status: newclosed

jQuery.fn.css getter returns computed but not relative value, but i agree, documentation might be more clear on that – https://github.com/jquery/api.jquery.com/issues/326

comment:3 Changed 10 years ago by anonymous

Seems like javascript can't actually get css properties only used values, but yeah the docs do read like you can. Maybe it needs to explain about used values. https://developer.mozilla.org/en-US/docs/Web/CSS/used_value?redirectlocale=en-US&redirectslug=CSS%2Fused_value

Note: See TracTickets for help on using tickets.