Keyword

K2 Content image custom resize with specific size

  • kullboys
  • kullboys's Avatar Topic Author
  • Offline
  • New Member
More
5 years 9 months ago #168251 by kullboys
Hello everyone
I have custom module to show k2 content in the three box layout. My design required 400 X 360px image size for box, some of the k2 content the medium image size 400 X 200px or 400 X 300px. Now my question is how can resize the k2 medium image size 400 X 360px instant of auto height.
Thanks .

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
5 years 9 months ago #168262 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Content image custom resize with specific size
Hello,

The most efficient way would be to use a CSS based resized. The image can be a background image of a block with the given dimensions, and you can use background-size: cover, to use all of the available space.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #169488 by DigiSol
Good Evening.

Krikor can you give me an example about how to make an item image as background in css?

Thanks a lot.

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #169497 by JoomlaWorks
Replied by JoomlaWorks on topic K2 Content image custom resize with specific size
You don't need to anymore. There's now this: developer.mozilla.org/en-US/docs/Web/CSS/object-fit

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #169521 by DigiSol
Thanks a lot Fotis. It works fine.

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #169524 by JoomlaWorks
Replied by JoomlaWorks on topic K2 Content image custom resize with specific size
Great :)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum