Answered max-width and max-height css properties ignored

  • Saturday, May 05, 2012 8:02 PM
     
     

    Hello,

    I've made an image gallery that makes images fit the frame using min-width/height properties. It works in Firefox 3-12, Opera and google chrome. In Internet Explorer the property is ignored and images have their original size.
    So is there some other CSS way how to resample images? Of course, I want to preserve height/width.


    Litera scripta manet!

All Replies

  • Saturday, May 05, 2012 9:29 PM
     
     Answered

    Hi,

    Add a valid Document Type Declaration.


    Rob^_^

    • Marked As Answer by Jakub Mareda Sunday, May 06, 2012 10:35 AM
    •  
  • Sunday, May 06, 2012 10:35 AM
     
     
    Seems that it works now, when document is XHML valid. Thank you very much. But what has CSS to do with doctype?

    Litera scripta manet!

  • Sunday, May 06, 2012 8:04 PM
     
     

    a document without a DTD renders in Quirks mode in ALL versions of IE... other browsers add a html4 dtd without a systemid to force the browser to use the html4 parsing and syntax.....

    Adding a DTD forces ALL browsers to (attempt) to use Standards mode rendering (except IE5x which only understands Quirks)...

    IE7 or IE7 emulation mode will render using 'Near Standards. IE8 and higher will use Standards mode. (document.compatMode)

    to future proof your pages you should use xhtml5 dtd.

    <!doctype html>

    All versions of IE do not know about new style rules that have been ratified and added to IE's DOM model, that is why an IE browser using Quirks mode or 'Near Standards' mode (or IE5 6 7) ignore min-width rules.

    see http://msdn.microsoft.com/en-us/ie/aa740469.aspx


    Rob^_^