This topic is locked

URL Image getting cut off when displaying

4/9/2024 5:46:28 PM
ASPRunner.NET General questions
S
stevehodges author

I have a text field that is getting cut-off when displaying.

Field Name: Product_Redirect URL

Is being controlled from here
https://xlinesoft.com/asprunnernet/docs/view_as_settings_image.htm

Under the "Image Area Dimensions"
width
height

Which only allows for "px" values. I need it to be percentages for the image to view correct when listing to page.

T
Tim 4/15/2024

I recently had a similar need. I solved it by using the "inspect" dev tools to determine the class of element containing the image, and then adding CSS in the "Style" section of ASPR. Here is the CSS that worked for me:

.r-images > img {
object-fit: contain !important;
max-width: 100% !important;
max-height: 100% !important;
height: 200px;
}

I am no expert at CSS (quite the opposite) but I found this solution from some Google searches. There are several ASPR forum posts and blog posts showing how to use dev tools to find the class of the element you'll need to target.

Hope this helps.
Thanks,
Tim