MyBB Community Forums
[How To?] MyCode Image Alt Responsive? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] MyCode Image Alt Responsive? (/thread-223382.html)



MyCode Image Alt Responsive? - mrdangem - 2019-06-11

After applying the Image Alt 

Expression
\[img alt=(.*?)\](.*?)\[/img\]

and 

Replacement
<img src="$2" alt="$1" title="$1" />


It really works out, the Alt attribute is working however, on mobile views the images are not responsive.
The height seems normal but the width is overlapping on the screen. 

Can anyone help me?


RE: MyCode Image Alt Responsive? - NoRules - 2019-06-11

Hi,

as is said here:

https://www.w3schools.com/howto/howto_css_image_responsive.asp



change the Replacement to:

<img src="$2" alt="$1" title="$1" class="responsive" />


And add the class to your global.css:

.responsive {
  max-width: 100%;
  height: auto;
}



RE: MyCode Image Alt Responsive? - mrdangem - 2019-06-13

@Norules, I think it will not work because the theme is already responsive.

The images as well, the only problem is when I applied the Alt description using mycode the images is not responsive now.


-----------

I wonder if its possible to add "width="100%" height="100%" in the replacement? or something like customizing its size manually?