Replies

May 25, 2020 5 years ago
Haswari
has seen too much
User Avatar
Starling-

I want to create a new profile section with an image in it, but obviously I want the image to fit. The image is huge on its own and I can't set it to an exact size as different screens would change the outcome. I know there's some code for making an image fit proportionately into a space, but this is obviously an ELI5 situation. It just seems however I enter the html (if it's even the right code) it doesn't work. The image doesn't appear, or it's still too large for the section.

I have the photo on imgur if it makes a difference. The direct link comes up with a blank image with the code I've attempted and the html code from there includes an imgur link border, so I don't even know what the hell link to use now.

I feel like this is probably no more than a few lines of html but... Yeah, I don't know what the hell I'm doing.

[egg=Haswari] 👻 [tp=Haswari] Holiday, Lifelikes and others for trade <3 Wishlist

May 26, 2020 5 years ago
Frenchi
is hopelessly romantic
User Avatar
Vivisect

can i see the code you're using?

May 26, 2020 5 years ago
Haswari
has seen too much
User Avatar
Starling-

It's literally just Google search results, which shows how much I know about coding. It seems that it doesn't acknowledge that the profile sections are a certain size.

I tried height/width/image contain, tried some longer code too but I haven't found how to make it work. It's probably the most basic html code so there's likely a ton of stuff missing if it's doable. I don't even know if CSS works on user profiles.

           TITLE   

[egg=Haswari] 👻 [tp=Haswari] Holiday, Lifelikes and others for trade <3 Wishlist

May 26, 2020 5 years ago
Frenchi
is hopelessly romantic
User Avatar
Vivisect

well first of all you don't need all those extra HTML tags, since that's all stuff that's already in the existing profile code, in which your profile text is nested. you just need the image tag itself.

second of all, it looks like you're missing the quotes around the height and width, but even if you included them, defining them both as 100% wouldn't give you the result you wanted; the 100% refers to the size of the container in which you are inserting the image, so by setting the height to 100%, you're essentially telling the image to stretch itself vertically to fill the entire height of the container. you just want to tell the width to match the width of the container, and the height will automatically scale proportionally.

in this case, you don't even necessarily need to use the style attribute to define the width; you can just define the width outright using the width attribute. the style attribute is useful if there might be something in the CSS that conflicts with how you want a particular image to display, but since that's not the case, it's not necessary.

so, all that said, this is the code you'll want to use:

May 26, 2020 5 years ago
Haswari
has seen too much
User Avatar
Starling-

It worked! Thank you! ^^

[egg=Haswari] 👻 [tp=Haswari] Holiday, Lifelikes and others for trade <3 Wishlist

Please log in to reply to this topic.