-
AuthorPosts
-
September 19, 2022 at 2:53 pm #1365548
Hi Enfold team,
I´m using a timelline on my site with images instead of icons for the milestones.
I tried to bring each image (=milestone) to a width of 100% on mobile devices (<767px) with the following css:.
@media only screen and (max-width: 767px) {
.avia-timeline .milestone_icon {
width: 100% !important;
height: auto !important;
}
}This works great for the width, but the height is incomplete (I tried to keep the proportions of the image with “auto” for height).
Unfortunately it doesn´t work, please see screenshot.Please let me know how to keep the proportions of each image/milestone on all screen sizes.
Thank you very much in advance.
Best regards,
fkmSeptember 20, 2022 at 8:42 am #1365644Hey fkm,
Thank you for the inquiry.
Try to this css code to adjust the height of the timeline images on smaller screens.
@media only screen and (max-width: 767px) { .av-no-preview .avia-timeline .milestone_icon.milestone-icon-hasborder .milestone_inner { line-height: 300px; } }
You may need to toggle or temporarily disable the Enfold > Performance > File Compression settings after adding the css.
Best regards,
IsmaelSeptember 20, 2022 at 9:42 am #1365656Hey Ismael,
thank you very much for your reply and the css code – it works well.
But actually I´d like to keep the original proportions of the images.
Is there a way to get the width-to-height ratio of the original images used for the milestones on every device/view?Thanks a lot in advance for another reply.
Best regards,
fkmSeptember 20, 2022 at 12:53 pm #1365695Hi fkm,
Can you try changing this part of Ismael’s code:
line-height: 300px;
to:
aspect-ratio: 15/9;
Let us know if it helps.
Best regards,
NikkoSeptember 20, 2022 at 3:07 pm #1365714Hi Nikko,
it helps, works great – thank you very much.
In addition, please let me know how to apply the same aspect ratio to the milestones in general/for other devices (computer, tablet) as well.
Thanks a lot in advance,
fkmSeptember 20, 2022 at 3:30 pm #1365718Hi fkm,
Just replace this code:
@media only screen and (max-width: 767px) { .av-no-preview .avia-timeline .milestone_icon.milestone-icon-hasborder .milestone_inner { aspect-ratio: 15/9; } }
with: (and that should apply on all devices)
.av-no-preview .avia-timeline .milestone_icon.milestone-icon-hasborder .milestone_inner { aspect-ratio: 15/9; }
Hope this helps.
Best regards,
NikkoSeptember 20, 2022 at 4:01 pm #1365726Hi Nikko,
that was also my first intention and I tried but it didn´t seem to work.
With the following css code I could define the pixel size of the milestone images (but not the aspect ratio that I´d like to get).
Without the following css code the images are shown as small squares..avia-timeline .milestone_icon {
height: 177px !important;
width: 320px !important;
}Is there a simple way to define the number of milestones per slide and their size or width with uniform aspect ratio for the different devices (computer, tablets > portrait and landscape format)?
Thanks a lot for another reply in advance.
Best regards,
fkmSeptember 22, 2022 at 11:58 pm #1366052Hi fkm,
Try to remove all the codes we gave and just replace it with:
#top .avia-timeline .milestone_icon { height: 177px; width: 320px; aspect-ratio: 320/177; }
Basically just set height and width.
For aspect ratio the value should be: width/height.Best regards,
NikkoSeptember 23, 2022 at 12:12 pm #1366097Hi Nikko,
thank you very much for your reply.
I was just trying out several options with the aspect-ratio in this css code but unfortunatelly none of them seem to be working on my end.
I also was probably wrong earlier in this topic when I said it worked – sorry!Please let me know if there´s any other way to get a consistent aspect ratio of the milestone icons for all devices?
Thank you very much in advance.
Best regards,
fkmSeptember 28, 2022 at 2:34 am #1366648Hi fkm,
I apologize for the delayed response.
Please try to remove this CSS code:@media only screen and (max-width: 767px) { .avia-timeline .milestone_icon { width:100% !important; } }
Let us know if it helps.
Best regards,
NikkoSeptember 30, 2022 at 1:59 pm #1367102H Nikko,
no need to apologize – thank you very much for your response.
I think I couldn’t make my request clear with using sample milestone images of different sizes and ambiguous descriptions.
That’s why I now only use one example image (in one size) for all milestones and made new screenshots (photomontages) for you to watch:The original image now has an resolution of 1280 x 720 px (= aspect ratio 16:9).
Please see screenshot: milestone-image_1280x720px.jpg
I´d like to keep this aspect ratio for all devices so that the image can always be seen as a whole:
On large screens with a width of about 320 pixels and on smartphones (portrait format) over the full width (100%).
Please see screenshots: timelline-milestones_desktop-view.jpg + milestone-image_mobile-view.jpgPlease let me know how this can be done.
Thanks a lot in advance.
Best regards,
fkmOctober 1, 2022 at 3:05 am #1367167Hi fkm,
Yes it can be done, please use this CSS code:
#top .avia-timeline .milestone_icon { width: 100%; padding-top: 56.25%; } #top .avia-timeline .milestone_inner { position: absolute; width: 100%; height: 100%; left: 0; top: 0; padding: 0; }
Best regards,
NikkoOctober 5, 2022 at 10:13 am #1367654Hi Nikko,
I was able to make all adjustments as desired (and even better) with this CSS code – thank you so much.
To make the milestones a bit smaller and thereby get more dashed lines (=more timeline charakter), I changed the values as follows and it worked fine:
#top .avia-timeline .milestone_icon { width: 80%; padding-top: 44.45%; }
However, a thin line out of the next milestone can now be seen on the right side of the page on the desktop view (not on other devices).
Please see page or screenshot.
Please let me know how to fix this.Thank you very much in advance.
Best regards,
fkmOctober 6, 2022 at 11:09 am #1367792Hi fkm,
Try adding this CSS code as well:
#top #avia-timeline-1 { max-width: 1107px; }
The code is global and may affect timelines on other pages, please review your site especially the ones with timelines.
Best regards,
NikkoOctober 6, 2022 at 12:12 pm #1367800Hi Nikko,
thank you very much – that worked fine, it looks just great.
Please feel free to close this topic as successfully completed.
Best regards,
fkmOctober 6, 2022 at 12:22 pm #1367804Hi fkm,
I’m glad that we could help you :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Timeline (milestones): keep proportions of icons (images) on mobile view’ is closed to new replies.