www.webdeveloper.com
Results 1 to 2 of 2

Thread: need a script that scale height of an image with the browser

  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Angry need a script that scale height of an image with the browser

    Well I've been trying countless hours to make this work with only css but I can't seem to be able to. I know there is a javascript function that calculates the size of the window but I have no idea how to apply it to my image and make it scale automatically. (needs to be 125px from bottom)

    What I need is a fixed div that will resize with the window (as well as scale the image inside it). Here's my current css code that works but not quite.
    Code:
    #mydiv
    {
    	position: fixed;
    	text-align: center;
    	bottom: 125px;
    	width: 100%;
    }
    #mydiv img{width: 55%; max-height: 700px;max-width: 950px;overflow:hidden;}
    #mydiv h3{ color: #bbbbbb;font-size: 8pt;font-family:arial;letter-spacing: -0.5px;}
    as for the html:
    Code:
    <div id="mydiv">
    <img src="myimage.png"/><h3>all rights reserved.</h3></div>
    ----

    Please help, pretty sure this is possible with javascript. thanks.

  2. #2
    Join Date
    Feb 2012
    Posts
    2
    Here's the current website for those who wonders. the image does scale with the width, but I can't make it work with the height (as it crops the top).

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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



Recent Articles