MyBB Community Forums

Full Version: MyCode Image Alt Responsive?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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;
}
@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?