Advertisement:

Author Topic: Auto resizing of images in posts, etc by CSS.  (Read 135156 times)

Offline crashbox

  • Newbie
  • *
  • Posts: 6
Re: Auto resizing of images in posts, etc by CSS.
« Reply #80 on: October 31, 2013, 04:46:38 PM »
Did you read the info at the link?


Yup but it does not make sense still to what gets added where and a how to do :-(

Offline IchBin™

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,116
  • Gender: Male
  • I don't speak German.
Re: Auto resizing of images in posts, etc by CSS.
« Reply #81 on: November 01, 2013, 04:53:09 PM »
And what about the examples given at any of these links?
IchBin™        TinyPortal

Jack_Elixir

  • Guest
Re: Auto resizing of images in posts, etc by CSS.
« Reply #82 on: May 03, 2014, 10:20:56 PM »
/* Auto resizing of avatars in posts and personal messages. */
/* Change sizing to suit your own preferences. */
.avatar>a>img, li.avatar>img {
   height: auto;
   width: auto;
   max-height: 150px;
   max-width: 105px;


above code is not resize avatar in posts, at 2.0.7


everythingelse is ok

Offline Taifuuni

  • Newbie
  • *
  • Posts: 5
Re: Auto resizing of images in posts, etc by CSS.
« Reply #83 on: July 21, 2014, 12:34:43 PM »
Is it anyway possible to set max width for attached image? I tried to set it but it affects the thumbnail also. Can't set it specifically to the enlarged thumbnail. Is this doable with CSS or does it need tweaking in the javascript files or elsewhere?

Offline -Captain Ghost-

  • Jr. Member
  • **
  • Posts: 110
  • Gender: Male
Re: Auto resizing of images in posts, etc by CSS.
« Reply #84 on: August 25, 2014, 10:24:31 PM »
Everything works fine but avatar resize won't work

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,669
  • Master of BBC Abuse
Re: Auto resizing of images in posts, etc by CSS.
« Reply #85 on: August 26, 2014, 02:43:40 AM »
Try just using img.avatar instead.

Offline -Captain Ghost-

  • Jr. Member
  • **
  • Posts: 110
  • Gender: Male
Re: Auto resizing of images in posts, etc by CSS.
« Reply #86 on: August 28, 2014, 08:19:14 AM »
Try just using img.avatar instead.
Sorry but i don't know where to replace
Can you do it

Thanks

Offline peter_pan_oO

  • Newbie
  • *
  • Posts: 4
Re: Auto resizing of images in posts, etc by CSS.
« Reply #87 on: September 02, 2014, 04:22:44 PM »
mhhh it does not seem to work for me. any ideas?

Code: [Select]
http://forum.truthtube.de/dokumentationen/the-act-of-killing-%282012%29
I included the code via the admin cp. Should I do this via my ftc program?
Also I am new to SMF, so please have patience with me ;)

EDIT: It kind of works now, but the text still breaks out.
Code: [Select]
/* Auto resizing of images in signatures. */
/* Change sizing to suit your own preferences. */
.signature>img, .signature>blockquote>img,
.signature>.bbc_link>img, .signature>blockquote>.bbc_link>img {
   height: auto;
   width: auto;
   max-height: 150px;
   max-width: 50%;
}

Edit 2: working after I changed    width: auto; --->    width: 50%;
« Last Edit: September 02, 2014, 05:42:29 PM by peter_pan_oO »

Offline johnpereless

  • Newbie
  • *
  • Posts: 1
Re: Auto resizing of images in posts, etc by CSS.
« Reply #88 on: September 29, 2014, 06:44:53 AM »
Well, I am not that technical and I don't use CSS but it's my curiosity to work on CSS! Thanks buddy for nice explanation.

Offline acepnoor

  • Semi-Newbie
  • *
  • Posts: 27
Re: Auto resizing of images in posts, etc by CSS.
« Reply #89 on: October 11, 2014, 10:43:14 AM »
great, I will try your css, thats what I m looking for..thanks for the share friend  :D

Offline Fotoforofos.com

  • Semi-Newbie
  • *
  • Posts: 15
    • Fotoforofos
Re: Auto resizing of images in posts, etc by CSS.
« Reply #90 on: January 14, 2015, 04:56:24 PM »
Thanks for the tip, i'm using it to resize images inside quotes:

Code: [Select]
blockquote img {
   height: auto;
   width: auto;
   max-height: 150px;
   max-width: 125px;
}

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,669
  • Master of BBC Abuse
Re: Auto resizing of images in posts, etc by CSS.
« Reply #91 on: January 14, 2015, 05:01:54 PM »
I use it basically everywhere. Very useful for responsive sites. :)

Offline mcelliot_g

  • Semi-Newbie
  • *
  • Posts: 11
Re: Auto resizing of images in posts, etc by CSS.
« Reply #92 on: February 24, 2015, 05:23:57 PM »
Hi everyone, this is my first post!
I have a little question, I just converted my forum from phpbb3 to smf, (almost) everything went fine and I used the css code provided here at the end of every theme i installed. While it auto resizes each image on the posts to fit the user's screen with no problems, I was wondering how I could make an image return to its original size by clicking on it and vice versa, just like it's done on attached images thumbnails. I saw on some examples here that this is possible, but it's not working on my forum. Is this the expected behaviour or am I missing something?
Thank you so much in advance!

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,669
  • Master of BBC Abuse
Re: Auto resizing of images in posts, etc by CSS.
« Reply #93 on: February 24, 2015, 07:09:06 PM »
It's expected behaviour. However, you can still see the original image by right click > View Image.

Offline mcelliot_g

  • Semi-Newbie
  • *
  • Posts: 11
Re: Auto resizing of images in posts, etc by CSS.
« Reply #94 on: February 24, 2015, 09:29:23 PM »
Thank you so much for your reply! I guess clicking on image as I explained would require javascript, if I am correct? Anyway, your modifications worked as a charm! Thanks again!

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,669
  • Master of BBC Abuse
Re: Auto resizing of images in posts, etc by CSS.
« Reply #95 on: February 27, 2015, 11:55:19 PM »
Yes, it would require javascript. You could write it yourself if you wanted to, or someone might write it for you if you asked.

Offline samk2824

  • Newbie
  • *
  • Posts: 8
Re: Auto resizing of images in posts, etc by CSS.
« Reply #96 on: August 18, 2015, 10:41:06 AM »
Thank you for sharing this Amazing Tips, this will surely Help me in minimizing my site Load time too.  8)
Regards,

Offline Kindred

  • The Mean One
  • Lead Support Specialist
  • SMF Legend
  • *
  • Posts: 60,437
  • Gender: Male
    • Kindred-999 on GitHub
Re: Auto resizing of images in posts, etc by CSS.
« Reply #97 on: August 18, 2015, 12:11:53 PM »
no it won't...   resizing with CSS is still LOADING the original image and forcing it to be resized. This will not have any effect on load time.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Offline 1985

  • Semi-Newbie
  • *
  • Posts: 12
Re: Auto resizing of images in posts, etc by CSS.
« Reply #98 on: October 25, 2016, 05:52:42 PM »
This work fine in posts, but if you put URL in image it will not resize.

Offline landyvlad

  • Sophist Member
  • *****
  • Posts: 1,011
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Auto resizing of images in posts, etc by CSS.
« Reply #99 on: January 31, 2017, 08:49:03 PM »
Two questions.

1. Did you ever make this into a mod?  You ought to! Easier to manage/control that way.

2. If I make the suggested changes as per the OP - and don't like the result - is it an easy process to reverse?

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."