I am currently working on creating a dynamic style sheet for myself that I will use in the future, and therefore I want it to be dynamic and not hard coded.
I have an image class:
.image-round{
border-radius: 50%;
}
This class works nicely for all square images, but when I try rectangular images, I get an oval.
I tried getting around this by using jQuery, wrapping the image in a container, that I made have overflow hidden and set its height and width to be equal to the height of the image. This solved the problem, however now I am facing responsive issues.
When I try to scale the window down, the image becomes squished.
Now I wonder if there is a solution to solve this problem entirely dynamically, with no hard coding what so ever, making images in landscape as well as portrait round.
I really want to avoid having to check the images size on window resize, and then readjusting the containers size - as I am pretty sure this will take a lot of performance.
It is also not an option to use background image.