Help with <div>scaling for tablet and mobile phones
dualcoast
Registered Users Posts: 7 Beginner grinner
Hi I have FINALLY published my new SM site. It is still a work in progress but I am happy with the way it is looking on my monitor.
My problem is I used a <div> to create clickable images on the homepage and again on the portrait page that link to other pages that I created. When viewed on a small screen like a tablet or phone the images scrunch up and over lap each other.
I would rather they align vertically on the small screen or just show alt tags or just one image. I am not brilliant with html or CSS so if there is a better way to accomplish something similar to what I have please let me know.
Also any other feedback on the site is appreciated. Thank You!
My problem is I used a <div> to create clickable images on the homepage and again on the portrait page that link to other pages that I created. When viewed on a small screen like a tablet or phone the images scrunch up and over lap each other.
I would rather they align vertically on the small screen or just show alt tags or just one image. I am not brilliant with html or CSS so if there is a better way to accomplish something similar to what I have please let me know.
Also any other feedback on the site is appreciated. Thank You!
0
Comments
You'll have to change the url, picture, and alt tags though.
HTML:
[html]
<div class="image-wrap">
<div class="image">
<a href="link-to-gallery-here"><img src="url-of-picture-here.jpg" alt="Text Here" /></a>
<a href="link-to-gallery-here" class="caption">Text Here</a>
</div>
<div class="image">
<a href="link-to-gallery-here"><img src="url-of-picture-here.jpg" alt="Text Here" /></a>
<a href="link-to-gallery-here" class="caption">Text Here</a>
</div>
<div class="image">
<a href="link-to-gallery-here"><img src="url-of-picture-here.jpg" alt="Text Here" /></a>
<a href="link-to-gallery-here" class="caption">Text Here</a>
</div>
<div class="image">
<a href="link-to-gallery-here"><img src="url-of-picture-here.jpg" alt="Text Here" /></a>
<a href="link-to-gallery-here" class="caption">Text Here</a>
</div>
</div>
[/html]
CSS:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
That code gets it going in the right direction. It scales well on my laptop monitor when I reduce the browser size but on my iphone the photos get stretched long and thin. ???
Also I would like to try to
1. center the whole div block,
2. adjust the hover so that only one image reacts at a time
3. is there a way to shave off the ends of the caption stripe so it is not wider than the images?
Looking it my testing site, the 4 images are centered.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
It isn't doing that on my test-page, but I do see it on your site. Change 'max-width' to 'width' here in red:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
In my custom-template, my site uses a fixed-width. That's why it works on my site, and not yours. Change the 'max-width' should take care of that.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk