In association with heise online

21 February 2012, 16:42

WebKit browsers learn to calculate with CSS

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

WebKit logo The forthcoming CSS3 standard will include functions for dynamically calculating the width and height of elements. Following in the footsteps of Internet Explorer 9 and Firefox (since version 4), the open source WebKit engine now also supports the calc() function. News of the new feature comes from the WebKit blog. Until now, the calculation function has only featured in the nightly builds of WebKit and Chromium, so some delay is to be expected before it finds its way into Safari and Chrome proper.


Zoom Older browsers, including Opera, are not yet able to process the stylesheet calc() function

The current implementation is somewhat rudimentary, and in particular does not allow mixing of different units, making it of little practical use. calc() is most useful when relative units, such as %, and em (the point size of the current font, historically the width of the capital "M") need to be combined with fixed-size units such as px. The latter is often used with frames and images which need to remain a fixed size irrespective of the font and window size.

(ehe)

 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit