Automatically keep slider 16×9 in CSS?
-
Is there a way in the custom CSS to force the slider to remain 16×9? This way I can change the height in the Graphene Options without having to change anything else because the width will maintain the ratio.
I know I can simply create a custom CSS that forces the height & width of the slider, and I can manually figure things out for the ratio, so I’m somewhat just thinking out loud.
Mod
Have you googled this at all? I found this:
http://wemadeyoulook.at/en/blog/proportional-scaling-responsive-boxes-using-just-css/
(Look carefully at the comments, too.)
Not sure how you might implement that (you’d have to look carefully at the Graphene html), but here are a few others:
http://stackoverflow.com/questions/1495407/css-a-way-to-maintain-aspect-ratio-when-resizing-a-div
http://stackoverflow.com/questions/3380252/how-to-create-proportional-image-height-width
The “best” way seems to be with javascript, but according to those pages, you should be able to achieve this just through css.
I found this thread that I thought would help, but it didn’t: https://forum.graphene-theme.com/graphene-support/resizing-thumbnails-in-slider
My slider is set to use the Featured Image, not a thumbnail. I entered the php code listed in that thread but it did not impact the images. Is there some php code I can enter into the child theme’s functions.php that would resize the image to a specific width but dynamic height (729px wide, height respective of the original image’s ratio)? Even a static size (729×410) may be acceptable.
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
