Skip to main content
amrit1993
Level 3
March 2, 2016
해결됨

Image not getting resized

  • March 2, 2016
  • 9 답변들
  • 1828 조회

Hi all,

So I created a new page and tried to resize the height of the slider banner image I added. The general functionality is it gets resized but now, only the component and not the image is getiing resized.

Any help will be appreciated.

Thanks

이 주제는 답변이 닫혔습니다.
최고의 답변: kautuk_sahni

Hi

Please have a look at this post:-

Link:- http://stackoverflow.com/questions/8977957/can-i-change-the-height-of-an-image-in-css-before-after-pseudo-elements

//Can I change the height of an image in CSS :before/:after pseudo-elements?

Adjusting the background-size is permitted. You still need to specify width and height of the block, however. .pdflink:after { background-image: url('/images/pdf.png'); background-size: 10px 20px; display: inline-block; width: 10px; height: 20px; content:""; }

See more :- https://developer.mozilla.org/en-US/docs/Web/CSS/background-size#Browser_compatibility

I hope this would help you.

Thanks and Regards

Kautuk Sahni

9 답변

edubey
Level 10
March 2, 2016

Not clear with what you are trying to achieve

Are you using OOTB component?If yes..which one?

Can you share screenshots?

Lokesh_Shivalingaiah
Level 10
March 3, 2016

thats the OOB behaviour,

once you add an image to a component and then resize, it becomes the content of that page and stores the resize value to that particular page. If you want the actual image to be resized, then create a the rendition of an image when you upload.

creating renditions of an image : https://docs.adobe.com/docs/en/aem/6-0/administer/content/assets/xmp-writeback.html

amrit1993
amrit1993작성자
Level 3
March 3, 2016

Not an OOB component, right is what I am expecting, left side is what I am getting. Component not made by me.

edubey
Level 10
March 3, 2016

Thanks for screenshot.

It looks more of CSS, check the css for <img> tag in component, someone might have added fixed height and width.

amrit1993
amrit1993작성자
Level 3
March 4, 2016

Actually the component is working fine for the earlier pages but for the newly created pages only its not resizing.

amrit1993
amrit1993작성자
Level 3
March 4, 2016

So I was comparing the working and non working component using developer tools and in the working one only piece of code which was different was an ::after selector.

<span class="js-generated-after"/>

edubey
Level 10
March 4, 2016

Yup

this might be the change, it will be coming either from CSS or JS

try removing and see the behavior

kautuk_sahni
Adobe Employee
Adobe Employee
March 7, 2016

Hi

Please have a look at this post:-

Link:- http://stackoverflow.com/questions/8977957/can-i-change-the-height-of-an-image-in-css-before-after-pseudo-elements

//Can I change the height of an image in CSS :before/:after pseudo-elements?

Adjusting the background-size is permitted. You still need to specify width and height of the block, however. .pdflink:after { background-image: url('/images/pdf.png'); background-size: 10px 20px; display: inline-block; width: 10px; height: 20px; content:""; }

See more :- https://developer.mozilla.org/en-US/docs/Web/CSS/background-size#Browser_compatibility

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
amrit1993
amrit1993작성자
Level 3
March 21, 2016

Thanks a lot, yes the height and width propert along with the auto attribute of the height needed to be modified