Results 1 to 2 of 2

Thread: expression() of css in firefox

  1. #1
    Join Date
    Oct 2008

    Smile expression() of css in firefox

    Dynamic placing of images inside the div. i used the expression() to calculate the height and width of the image during runtime. but it is not working in the firefox.

    My coding is

    <style type="text/css">
    html>body div img { /*hidden from IE 5-6 */
    margin-top: 0; /* to clean up, just in case MS later supports valign! */
    vertical-align: middle;
    .coverImg {border:1px solid #ccc; width:321px;height:199px; font-size: 1em;margin-bottom:10px; margin-left:10px;}
    .coverImg img{margin-top: expression(( 199 - this.height ) / 2); margin-left:expression(( 321 - this.width ) / 2);}
    .invitationImgs {border:1px solid #ccc; width:120px;height:92px; font-size: 1em; float:right; vertical-align:middle; margin:0px 15px 13px 0px;}
    .invitationImgs img{ margin-top: expression(( 92 - this.height ) / 2);}

    Can anybody help me?

    Thanks in advance

  2. #2
    Join Date
    Apr 2003
    expression only works in IE (not recommended).
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center