Search code examples
javascriptjquerycsspixel

Does CSS accept 'pixel' in decimals?


I was going through jQuery functions.

Lets take this as an example:

http://api.jquery.com/slideUp/

If you do 'Inspect Element' on your browser, you can see the height of the div changing. The height takes decimal values of pixels. How to do that with javaScript?


Solution

  • Don't look things up on W3Schools, they are a bad source. In general, when you want to know something like this, just look at the specification. Lengths are <number>s, which can include fractional values.