1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Define image from url size?

Discussion in 'XenForo Questions and Support' started by Claudio, Jun 24, 2013.

  1. Claudio

    Claudio Well-Known Member

    Hi,

    I'd like to know if I can define a specific size for all images from a URL.
    Actually, I'm having this question due this image which is really big and I want to define the size of the preview of it on xenforo:
    [​IMG]
     
  2. Mike

    Mike XenForo Developer Staff Member

    Image sizes cannot be defined in the standard BB code.
     
    Claudio likes this.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Add to EXTRA.css:
    Code:
    .bbCodeImage {
    max-width: 100px !important;
    max-height: 100px !important;
    }
     
    Claudio likes this.
  4. Mike

    Mike XenForo Developer Staff Member

    Oh oops, I missed that it was for all images. (y)
     
    Claudio likes this.
  5. Claudio

    Claudio Well-Known Member

    You're an amazing team guys, thank you!
     
  6. Claudio

    Claudio Well-Known Member

    mmm I think I'm having problems with APC due I've made few changes to the style and they aren't reflected. However, I haven't set APC on config.php
     
  7. Claudio

    Claudio Well-Known Member

    Brogan,

    I tried the code above but it doesn't work.
    No matter what I set, the following code is displayed by xenforo:
    Code:
    .bbCodeImage {
    max-width: 100%;
    }
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    It works.
    I tested it.
     
    Claudio and Jeremy like this.
  9. Tracy Perry

    Tracy Perry Well-Known Member

    If it's not working, double check your EXTRA.css and make sure that you have all your closing "}" in place. It gets me occasionally even now.
     
    Claudio likes this.
  10. Claudio

    Claudio Well-Known Member

    Thanks for the suggestion. However, I have the same code that Brogan suggested but I made it 50% to notice the change (because I don't see any):
    Code:
    .bbCodeImage {
    max-width: 50% !important;
    max-height: 50% !important;
    }
    As I said, the code doesn't work on my forum (and I'm using a default style) with only style properties customized
     
  11. Claudio

    Claudio Well-Known Member

  12. Brogan

    Brogan XenForo Moderator Staff Member

    It's not a ticket issue.
    You just need to enter the code correctly.

    Using a browser inspection tool I can't see the code anywhere.

    I just changed it to 10%:

    upload_2013-6-30_19-12-10.png
     
    Claudio likes this.
  13. Claudio

    Claudio Well-Known Member

    I tried to move the code from the bottom of extra.css to the very beggining and then it worked, so as Tracy suggested, a } was missing in other part of Extra.css (I thought he was referring to the } on the code you provided Brogan.
    [quote="Tracy Perry, post: 574412, member: 30804"make sure that you have all your closing "}" in place.[/quote]

    Thank you both of you!
     
    Tracy Perry likes this.
  14. Tracy Perry

    Tracy Perry Well-Known Member

    If moving it to the top made it work then you were missing a closing } on one of your statements. If you haven't already, be sure to filter back through your EXTRA.css to find it (I use a Mac and the editor I use also allows me to find missing closers like this in a .css file easily).
     
  15. Brogan

    Brogan XenForo Moderator Staff Member

    Notepad++ is a great free editor and allows you to easily spot errors such as that.
     
  16. Claudio

    Claudio Well-Known Member

    That was what I noticed after checked that it was working :)
    Yes, I use it but my extra.css has only 40 lines and it's to less to worth the time to open the app, copy the code and check it :cautious:
     

Share This Page