How can we protect the photo's proportion in web site?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • springage
    New Member
    • Mar 2010
    • 2

    How can we protect the photo's proportion in web site?

    This one just auto size the width
    But how can we auto size the height?

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	#Refresh#
    	 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title></title>
    <style type="text/css">
    <!--
    body {
    	font-size: 12px;
    	text-align: center;
    	margin: 0;
    	padding: 0;
    }
    #pic{
      margin:0 auto;
      width:100%;
      padding:0;
      border:0px solid #333;
      }
    #pic img{
        max-width:100%; mywidth:expression(onload=function(){
    this.style.width=(this.offsetWidth >document.getElementById("pic").scrollWidth*8/10)? "100%": "auto"});
       
    	border:1px dashed #000;
    	}
    -->
    </style>
    
    
    </head>
    <body>
    <div id="pic">
    <img  src="#PARAM1#"  >
    	</div>
    </body>
    
    </html>
    Last edited by Markus; Mar 18 '10, 01:59 PM. Reason: Added [code] tags
Working...