locked
How to prevent image stretching in slider in ASP.NET RRS feed

  • Question

  • User1997788493 posted

    Hi Guys,

    I Created one slider, that is 430px height and 1170px width,i want to fit image according to that height and width,any size of image must need fit according to that size..how to do that ? i fallowed several methods but i couldn't prevent that image stretching, i used image in between div tags  and flex ..etc

    how to do this?

    Saturday, April 21, 2018 4:30 PM

Answers

All replies

  • User516094431 posted

    If you want a responsive image that always fills the frame, use a div with background image set to cover instead of the image widget.

    I personally don't apply a background image to the slide itself. It is better to nest a div with a background image instead - it will give you improved formatting options.

    How do I get image slider images not to stretch

    Sunday, April 22, 2018 10:01 AM
  • User36583972 posted


    Hi DDNaidu,

    i want to fit image according to that height and width,any size of image must need fit according to that size..how to do that ? i fallowed several methods but i couldn't prevent that image stretching, i used image in between div tags  and flex ..etc

    The following links may helpful for you.

    Fit image inside div without stretching:

    Make image fill div completely without stretching

    CSS Image size, how to fill, not stretch?


    Best Regards,

    Yong Lu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 23, 2018 9:15 AM
  • User-474980206 posted
    For an image to file a div without stretch, you can only set the width or height, not both. As you want height, remove the width=100%

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 23, 2018 2:14 PM