Forcing a Single Photo in Sidebar to Resize with Browser Window Size
viktor35mm
Registered Users Posts: 10 Big grins
Hi all,
Newbie here referred over from Smugmug support. Looking for an assist with my homepage @ www.viktor35mm.com.
Basically looking to have a photo on the left side of the page, with text and button + social on the right side as can be seen on my site.
To achieve this I had to use some workarounds as Smugmug doesn't seem to let me have two content blocks taking the up the same space as a single content block next to it.
I basically used both the left side-bar and the right side bar (maximised for size) and placed the photo in the left one, with the text/button and social on the right one.
Now this works great with a maximised browser window - however the second I decrease the size of the browser window, the photo from the left stays the same size and pulls over the text to the right.
I'm guessing this needs some kind of CSS workaround but as I'm not familiar with either HTML/CSS looking for help!
Newbie here referred over from Smugmug support. Looking for an assist with my homepage @ www.viktor35mm.com.
Basically looking to have a photo on the left side of the page, with text and button + social on the right side as can be seen on my site.
To achieve this I had to use some workarounds as Smugmug doesn't seem to let me have two content blocks taking the up the same space as a single content block next to it.
I basically used both the left side-bar and the right side bar (maximised for size) and placed the photo in the left one, with the text/button and social on the right one.
Now this works great with a maximised browser window - however the second I decrease the size of the browser window, the photo from the left stays the same size and pulls over the text to the right.
I'm guessing this needs some kind of CSS workaround but as I'm not familiar with either HTML/CSS looking for help!
Tagged:
0
Comments
I would use a single HTML/CSS block to design it. I know you don't have the knowledge, but if you tell me what exactly what the image and text are supposed to look like when the screen size gets smaller, I can help you.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Using a HTML/CSS block, add this to the HTML section:
Add this to the CSS section:
When the screen is less than 800px, it will put your content under your picture.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
There are only two issues remaining, 1: the button doesn't seem to work (I'll try playing around with the code) - and 2: there is a border around my image - is there a way to remove that and force the image to the edges? (I'll try looking around for this too).
Otherwise, thank you so so much!
There is a 12px margin (Dimensions) around the HTML/CSS by default. Set it to 0px for all 4 edges. The link works for me, did you fix it?
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
I tried having a separate container for the photo on the left and a container for HTML/CSS on the right (and removing the image code) but I then had scaling issues with the social button - so I guess that's a no go.
The button doesn't seem to work for me no. Can't figure out what's wrong with it.
Not sure why your button doesn't work for you because it works for me. Clicking it goes here: https://www.viktor35mm.com/Images which has no images.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
So with that tweak the image seems to have filled the HTML/CSS block, however there is still a tiny gap below the image. I figured it might be the login button (i logged out to check how it looks) so I removed that but nope, it's still there.
I do have a CSS placeholder below everything (for removing 'powered by smugmug' and the login) - could that be having some kind of impact? I've tried moving it above and it made no difference so I guess not.
Perhaps it's the photo being 1:1?
I mean it's not the worst thing, but it's strange there's a forced scroll wheel for it.
As for the button, that's even stranger - there's simply no way to click it for me. Even on different browsers (logged out).
Remove the
height: 100%;
as it doesn't work and it screws it up on Chrome.What OS and browser are you using? Your button works using Win7 with Firefox and Chrome.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
On my personal PC/laptop it works great on edge/firefox w10.
Have removed the height:100%.
I think I'll try using a different photo and see what happens - maybe the photo is too small?
Not an issue with the image. I'm currently looking into it.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
> Not an issue with the image. I'm currently looking into it.
Yup you're right. Made no difference no matter the size. Really appreciate your efforts.
Think I found it. Add
display: block;
here:Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
> Think I found it. Add display: block; here:
>
> .homepage__image img { max-width: 100%; width: auto; display: block; }
I think that might have done the trick! There's still a scroll bar (with a mm or 2 of movement), but no annoying bottom white bar which is excellent.
I can't see it yet from other browsers (guess it needs to update) but I reckon it's all good.
Thank you.
Onto the rest of the site for me :)
Pretty sure there was a scroll bar originally.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
> Pretty sure there was a scroll bar originally.
Yes there was - is there a way to remove it?
I think so, but if you want a 50% of the image and 50% of the "other stuff", something has to give (like cropping part of the image in CSS). May have to re-do some of the code. I'll take a look this evening/tomorrow. It's going to be similar to how the full-screen background works. Small screens will "crop" some of the image.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
> @viktor35mm said:
> Yes there was - is there a way to remove it?
>
>
>
>
>
> I think so, but if you want a 50% of the image and 50% of the "other stuff", something has to give (like cropping part of the image in CSS). May have to re-do some of the code. I'll take a look this evening/tomorrow. It's going to be similar to how the full-screen background works. Small screens will "crop" some of the image.
-----------------------
Cropping of the image would be no problem when the screen/browser is smaller; if it just crops from the edges equally inward then no problem at all.
In the meantime I'll look into how to adjust fonts in CSS - I'd like something more like futura font for the tagline and perhaps that or something else for the headline.
Again, really appreciate your efforts!
Remove the
<img src="https://photos.smugmug.com/2019/KL-Randoms/n-RNrKGN/i-c4HqdWm/0/a0303d5d/X4/i-c4HqdWm-X4.jpg" alt="" />
from your HTML section.In your CSS section, remove this:
Use this instead:
You're welcome. I enjoy it and it gives me something to do.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
One more thing about mobiles. You might want to use a smaller image for mobiles (less than ~800px wide) to save bandwidth.
Find the media queries on the bottom of your CSS section:
Use this instead:
You'll need to use the smaller version of your image in place of
url-for-the-smaller-version-here
.Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
You did it! Works beautifully!
The mobile part works well, though I need to resize a proper image when I get home as smugmugs internal resizing hits the quality a bit too much. There is one niggle though, is there a way to force a gap between the image (being at the top) and the title ''VIKTOR.35MM" for mobile only? As right now the title is glued to the base of the image.
Really really pleased with how it's come out - thanks to you I've learned a lot about how this all works .
You removed the padding I had here:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk