Responsive Images with CSS

前端 未结 6 475
南方客
南方客 2020-11-29 19:27

I\'m finding it tricky to resize images to make them responsive.

I\'m developing a php application to automatically convert a website to a responsive version. I\'m a

相关标签:
6条回答
  • 2020-11-29 19:28
    .erb-image-wrapper img{
        max-width:100% !important;
        height:auto;
        display:block;
    }
    

    Worked for me.
    Thanks for MrMisterMan for his assistance.

    0 讨论(0)
  • 2020-11-29 19:28

    um responsive is simple

    • first off create a class named cell give it the property of display:table-cell
    • then @ max-width:700px do {display:block; width:100%; clear:both}

    and that's it no absolute divs ever; divs needs to be 100% then max-width: - desired width - for inner framming. A true responsive sites has less than 9 lines of css anything passed that you are in a world of shit and over complicated things.

    PS : reset.css style sheets are what makes css blinds there was a logical reason why they gave default styles in the first place.

    0 讨论(0)
  • 2020-11-29 19:39

    check the images first with php if it is small then the standerd size for logo provide it any other css class and dont change its size

    i think you have to take up scripting in between

    0 讨论(0)
  • 2020-11-29 19:46

    Use max-width on the images too. Change:

    .erb-image-wrapper img{
        width:100% !important;
        height:100% !important;
        display:block;
    }
    

    to...

    .erb-image-wrapper img{
        max-width:100% !important;
        max-height:100% !important;
        display:block;
    }
    
    0 讨论(0)
  • 2020-11-29 19:50

    the best way i found was to set the image you want to view responsively as a background image and sent a css property for the div as cover.

    background-image : url('YOUR URL');
    background-size : cover
    
    0 讨论(0)
  • 2020-11-29 19:52

    Use max-width:100%;, height: auto; and display:block; as follow:

    image {
        max-width:100%;
        height: auto;
        display:block;
    }
    
    0 讨论(0)
提交回复
热议问题