User talk:StarshipSLS/User Siberian Husky
Infobox images
editHi StarshipSLS,
I just wanted to point out to you how to crop an image when it doesn't really fit the userbox space. You already are using |##px
and |x##px
after the image to resize it, but you can also crop an image using a little bit of CSS. For this userbox, try replacing your current id=
statement with this: id=<div style="width: 45px ; height: 45px; overflow: hidden">[[File:Siberian Husky watching outside.jpg|48px]]</div>
You can post all the html/CSS into The Super-Simple Userbox Maker or add it when you create the page here on Wikipedia. The first part, width:
and height:
are limiting the box size to the standard 45px × 45px square, the overflow: hidden
statement just makes everything outside of that box invisible. This keeps userboxes at a more standard height and helps you fill in the space better. You still want to use |##px
(to set a max width) or |x##px
(to set a max height) to resize the image and you might have to play with it a bit to get the crop/fill where you want it.
The main downside to this method is that it only crops from the upper-left corner of the image, so if there is blank space up and to the left and what you want to highlight is at the right or the bottom of the image, it doesn't work well. Carter (talk) 13:38, 20 May 2021 (UTC)
- @Tcr25: Thanks so much! StarshipSLS (Talk), (My Contributions) 13:41, 20 May 2021 (UTC)
- @Tcr25: Wow! It works well! StarshipSLS (Talk), (My Contributions) 13:42, 20 May 2021 (UTC)
- 👍🏼 Yep, it's a neat little trick... Carter (talk) 14:00, 20 May 2021 (UTC)
- @Tcr25: Wow! It works well! StarshipSLS (Talk), (My Contributions) 13:42, 20 May 2021 (UTC)
StarshipSLS, I put in an alternate photo. If you look at the code, you'll also see I played with the width:
and |##px
to get things to balance out between the photo and the space available. Oh, I also linked huskies, which is usually a good practice for userboxes. Carter (talk) 16:14, 20 May 2021 (UTC)
- @Tcr25: Thanks so much! StarshipSLS (Talk), (My Contributions) 18:07, 20 May 2021 (UTC)