General developer forum

Images resizable in phone

 
Picture of Simon Eidenskog
Images resizable in phone
 

Hi!

I'm using Moodle 3.2 with the Boost theme. 

I want images (which has a width of say about 700 px) posted for example on Home page, in forums, or as a label in a course to be resized when viewing In phone, so the whole width fit in to the iPhonescreen. (If there's an easy solution, it would be an option with a link in a new tag to full resolution image.)


In additional HTML, whitin HEAD, I've tried to add: 


 <style>

img {

    height: auto;

}

</style> 


In Raw SCSS (in Boost theme), I'ved also tried:


img {

    height: auto;

}


but with no result.


Thankful for your help!

Regards Simon

 
Average of ratings: -
Picture of Diane Soini
Re: Images resizable in phone
 

I think you need to also add a width: 100% to both those rules. You may need to wrap the rules in a media query, too.

 
Average of ratings: -