Osclass Support Forums

Osclass theme support => Free themes => Topic started by: Gilou26 on October 18, 2019, 11:52:56 AM

Title: Center the image on a mobile phone
Post by: Gilou26 on October 18, 2019, 11:52:56 AM
Good morning, everyone.
On the mobile phone, I try to center the image of the search results. I can't do it despite all the tests I did in the CSS files (main.css and bootstrap.min)
Someone could tell me what I need to do to center my image.
I attach a photo of the results displayed on PC and a photo of the results displayed on the mobile phone.
Thank you in advance for your help.

Osclass 3.8.0 / Osclasswizards 2.0.6
Title: Re: Center the image on a mobile phone
Post by: MB Themes on October 18, 2019, 02:59:26 PM
Try to use css styles on images:
Code: [Select]
margin:0 auto; display:block; float:none;
or set parent block to:
Code: [Select]
width:100%;text-align:center;
and image to:
Code: [Select]
width:auto;display:inline-block;float:none;
Title: Re: Center the image on a mobile phone
Post by: Gilou26 on October 18, 2019, 04:17:27 PM
Hello.
Thank you for your answer.
I used the code:

Code: [Select]
margin:0 auto; display:block; float:none;
but social network images were vertically superimposed
So I assigned your code to the "listing-thumb" in bootstrap.min like this:

Code: [Select]
.listing-thumb {
    width:100%;text-align:center;
    margin:0 auto; display:block; float:none;
}

It works perfectly.
Thank you very much for your help.