Welcome to TalkGraphics.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Location
    Canberra, Australia
    Posts
    121

    Default Image Height Truncation as Browser Window Size Increased.

    I have noticed that if I add an image to a web page and set it to Full Width and Scale Stretched Object under Web Sticky/Stretchy, when viewed in a browser the top and bottom of the image are truncated when the browser window size is increased. The width is resized correctly. Is there a way to have both the width and the height resize?

    The same behaviour happens with the Hipster template.

    Thanks,

    Steve

  2. #2
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: Image Height Truncation as Browser Window Size Increased.

    You can use some little CSS but that will only work in IE9 and later.
    Create your stretching image as usual.
    Add a name to it to define a class name: htmlclass=your_class_name
    Add some code to the page head (or body if you like)
    Code:
    <style>
    .your_class_name { height: calc(100vw / 500 * 295) !important; }
    </style>
    Replace your_class_name with the class name you chose when giving the htmlclass= name.
    Don't forget to place the dot before the class name.
    Replace the 500 * 295 with the size of your image.
    Click image for larger version. 

Name:	full_height_stretchy.png 
Views:	77 
Size:	124.8 KB 
ID:	117329

    See example file.

    You can reuse the name for other stretching images that have the same aspect ratio.
    Attached Files Attached Files

  3. #3
    Join Date
    Mar 2009
    Location
    Canberra, Australia
    Posts
    121

    Default Re: Image Height Truncation as Browser Window Size Increased.

    Quote Originally Posted by siran View Post
    You can use some little CSS but that will only work in IE9 and later.
    Create your stretching image as usual.
    Add a name to it to define a class name: htmlclass=your_class_name
    Add some code to the page head (or body if you like)
    Code:
    <style>
    .your_class_name { height: calc(100vw / 500 * 295) !important; }
    </style>
    Replace your_class_name with the class name you chose when giving the htmlclass= name.
    Don't forget to place the dot before the class name.
    Replace the 500 * 295 with the size of your image.
    Click image for larger version. 

Name:	full_height_stretchy.png 
Views:	77 
Size:	124.8 KB 
ID:	117329

    See example file.

    You can reuse the name for other stretching images that have the same aspect ratio.
    Excellent, thanks Siran.

 

 

Bookmarks

Posting Permissions

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