How to I make a link the same size as an image


I followed the instructions here to turn an image into a link:

But the link is larger than the image - how do I make it the same size?


So the link was in a column and took up the whole width which was wider than the image so I just moved it into a regular paragraph and the link automatically resized to the size of the image. Lots I don’t really understand about HTML, CSS & Bootstrap but my website’s pretty much complete now and Studio has been a massive help.

I was unable to reproduce your issue. When I followed the BSS instructions, the link width became the same as the width of the image. By any chance did you accidentally have Link Options > Stretch set to “on”?

Stretch is set to off. I can’t reproduce it now anyway - if I create a new project, add a row with two columns, drag a link into one of the columns, delete the text, then drag an image on to the link, it does now resize the link to the size of the image.

I have occasionally had inexplicable things happen at times, and then when I try to reproduce the problems, I can’t. It’s probably the result of doing something subtle without realizing, and not being able to backtrack to what it was that caused it.

Whenever I encounter something I consider “aberrant” behavior in BSS, my first step is always to create a blank project, and see if I can reproduce the issue. Or if it’s something that has suddenly changed in an site i have had for a while, I’ll start exploring backups until I find the first one that doesn’t have the issue, and then I’ll try copying the component from the older site into the newer site. This tells me if it’s something involving the component, or the CSS of my current site.

I just had this happen last week. I noticed a container had a vertical scroll bar that was never there before. I could not find any reason why it should have been there. It was on a site I was updating, which I routinely update a few time a month. I hunted around for a few minutes trying to see if it was something in my CSS, or if I changed a utility class, but I couldn’t find the problem. Finally, I just opened a version of the site from a backup made last month, copied the particular component, pasted it into my current site and voila… the pasted component had no scroll bar.

Whatever the cause, in this case, I just didn’t have the time to hunt it down. It was just simpler to do a down-and-dirty fix. Sometimes, time is the most valuable asset.