What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

How to limit image size and set maximum height and width that fits the screen size?

fa2020

New member
Joined
Jul 23, 2021
Messages
3
Reaction score
0
HTML Coins
0
Hi,
In the following html/css code, when I click on an image that has a high resolution (1000*2500) the image appears zoomed and out of the screen. How can I make them fit on the screen when the image size is high enough?
<div style="display:none;" id="<?php echo $nID; ?>" class="bFulIm">
<button id="closeBTNs" onClick='shBC()'>CLOSE</button>
<img src="files/<?php echo $URL; ?>">
</div>

.bFulIm {
width: 90vw;
}
.bFulIm img{
width: 100%;
-webkit-box-shadow: 0px 4px 33px 0px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 4px 33px 0px rgba(0,0,0,0.3);
box-shadow: 0px 4px 33px 0px rgba(0,0,0,0.3);
}
.bFulIm { /*that's the big image preview*/
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9999;
max-height: 100%;
}
 
Hi, I got your issue..
Let me try to help you out with this..
You can try changing CSS as shown below..

position: absolute;
width: 100%;
height: 100%;
overflow: hidden;

This will help any of your images to fit in your screen size..

Hope this help,
Regards,
Jim W
 
if there is a <style> tag ,type tagname{max-width:???%;max-height:???%;}
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back