Advertisement:

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

Offline CheeseHead05

  • Jr. Member
  • **
  • Posts: 388
Re: Auto resizing of images in posts, etc by CSS.
« Reply #60 on: June 26, 2013, 10:08:16 AM »
Ant,

http://forums.solematesxoxo.com/nikeadidas/index.php?topic=3.0

*The large pic is from when I open it in google images.

Offline HunterP

  • Sr. Member
  • ****
  • Posts: 977
  • Gender: Male
  • SMF 2.0.4
    • Hulpverleningsforum Nederland
Re: Auto resizing of images in posts, etc by CSS.
« Reply #61 on: June 26, 2013, 03:19:36 PM »

Ant,

What do you exactly mean with this line?

/* This prevents images breaking out of the post on small screens. */
   max-width: 95%;




Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,669
  • Master of BBC Abuse
Re: Auto resizing of images in posts, etc by CSS.
« Reply #63 on: June 26, 2013, 06:52:59 PM »

Ant,

What do you exactly mean with this line?

/* This prevents images breaking out of the post on small screens. */
   max-width: 95%;

If you set it to 100% it will pick up the full size of the parent element, including any padding the parent has, and use that as the size of the image. That can give overflow problems, so allowing a 5% margin just makes overflow unlikely.
« Last Edit: June 27, 2013, 05:11:23 PM by Antechinus »

Offline CheeseHead05

  • Jr. Member
  • **
  • Posts: 388
Re: Auto resizing of images in posts, etc by CSS.
« Reply #64 on: June 27, 2013, 02:56:39 PM »
http://forums.solematesxoxo.com/nikeadidas/index.php?topic=3.0

K@ and Ant,

you should be able to view now..

Offline HunterP

  • Sr. Member
  • ****
  • Posts: 977
  • Gender: Male
  • SMF 2.0.4
    • Hulpverleningsforum Nederland
Re: Auto resizing of images in posts, etc by CSS.
« Reply #65 on: June 27, 2013, 03:02:37 PM »
http://forums.solematesxoxo.com/nikeadidas/index.php?topic=3.0
K@ and Ant,
you should be able to view now..

The topic or board you are looking for appears to be either missing or off limits to you.
Please login below or register an account with Nike/Adidas.

Offline CheeseHead05

  • Jr. Member
  • **
  • Posts: 388
Re: Auto resizing of images in posts, etc by CSS.
« Reply #66 on: June 28, 2013, 10:39:48 AM »
Ant, did you get a chance to check  it out?

Offline ryan_dwight

  • Jr. Member
  • **
  • Posts: 296
Re: Auto resizing of images in posts, etc by CSS.
« Reply #67 on: July 27, 2013, 03:33:21 PM »
hi,

i used the code in the first post but not all images are resized, example in this thread

thank you

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 #68 on: July 27, 2013, 10:18:11 PM »
Looking at your topic in the link you posted, looks to be working just fine for me.
IchBin™        TinyPortal

Offline ryan_dwight

  • Jr. Member
  • **
  • Posts: 296
Re: Auto resizing of images in posts, etc by CSS.
« Reply #69 on: July 28, 2013, 11:12:50 AM »
Ok thanks because on the page 2 all images are big. Maybe on my pc only. Thanks

Offline DSystem

  • Jr. Member
  • **
  • Posts: 238
  • Gender: Male
  • EletronicaBR - Admin
    • eletronicaBR.com
Re: Auto resizing of images in posts, etc by CSS.
« Reply #70 on: October 26, 2013, 12:06:16 PM »
Great change in the CSS. Should be incorporated into the SMF default theme.

Congratulations on your great idea.

Offline BGH

  • Semi-Newbie
  • *
  • Posts: 93
Re: Auto resizing of images in posts, etc by CSS.
« Reply #71 on: October 27, 2013, 10:24:50 AM »
This works pretty well inside topics, but what about "action=recent", "action=post;topic=#;last_msg=#", or "action=profile;area=showposts;u=#"?

Is there a way to modify the CSS to make it work in those actions, too?

Best Regards.

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,669
  • Master of BBC Abuse
Re: Auto resizing of images in posts, etc by CSS.
« Reply #72 on: October 27, 2013, 05:28:02 PM »
It'd just be a matter of applying the right targeting for the CSS. Can't remember offhand what the elements are in those sections, but Firebug or Web Developer would get them for you. I'm too lazy to look them up right now. :)

Offline crashbox

  • Newbie
  • *
  • Posts: 6
Re: Auto resizing of images in posts, etc by CSS.
« Reply #73 on: October 28, 2013, 11:55:27 AM »
Hi Antechinus or anyone else that could help

I have installed sms a few days ago with a new theme and have edited the background image
The problem is i look at the website in 1920 x1080 but some users that are viewing the site are using lower resolutions which knocks the background image out of alignment.

I could forward you the link to the site to show you what i mean on different resolutions.
Do i need to add your code Antechinus to the main smf css or to the template css.

Sorry im new to this and im finding my feet.

Best regards

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Auto resizing of images in posts, etc by CSS.
« Reply #74 on: October 28, 2013, 12:00:12 PM »
This code isn't about resizing the background picture, but about resizing pictures inside posts.

In fact I'm not sure there's a *good* way to get background pictures to work right...
No good deed goes unpunished
All helpful urges should be circumvented

Offline crashbox

  • Newbie
  • *
  • Posts: 6
Re: Auto resizing of images in posts, etc by CSS.
« Reply #75 on: October 28, 2013, 12:09:48 PM »
Ok thanks for the reply,

So how do web developers create a site that fits all ie: pc's / tablets / phones and so forth. I would of thought what they do is pretty much resizing the whole template with images.

Sorry if i sound a little naive i am just trying to get my head around changing the background image to fit all resolutions used

Best regards   

Offline IchBin™

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,116
  • Gender: Male
  • I don't speak German.
IchBin™        TinyPortal

Offline crashbox

  • Newbie
  • *
  • Posts: 6
Re: Auto resizing of images in posts, etc by CSS.
« Reply #77 on: October 28, 2013, 12:40:17 PM »
This is what iam having the problem with but im still a little lost

hxxp:173rd.us.173rd.us/Themes/Black_Ops_2/images/theme/bg_body.jpg [nonactive]  <<needs to resize to all resolutions

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 #78 on: October 28, 2013, 03:02:31 PM »
Did you read the info at the link?
IchBin™        TinyPortal

Offline BGH

  • Semi-Newbie
  • *
  • Posts: 93
Re: Auto resizing of images in posts, etc by CSS.
« Reply #79 on: October 28, 2013, 07:09:31 PM »
It'd just be a matter of applying the right targeting for the CSS. Can't remember offhand what the elements are in those sections, but Firebug or Web Developer would get them for you. I'm too lazy to look them up right now. :)

Fair enough, will check it later then, and see what I can come across :)

Thanks for the code, it's very handy!  :)

I'm also one of those who think this should be default in SMF :p, maybe handed through the admin center, somehow?

Regards.