Pictures in Fluid Sites - Post ID 200904

User 252350 Photo


Registered User
6 posts

I set up this site in the new template for fluid sites, or responsive as you call them, I have a picture in the index page that looks very good on a browser, however, when I open it up on a I Phone 4S the picture is distorted. I try several different sizes of pictures, I use Photoshop to re-size the picture. Can you suggest what I can do to clear this up?
www.dickstantonarb.com
Thanks.
User 187934 Photo


Senior Advisor
20,247 posts

This maybe.
img {
max-width: 100%;
}
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

<div align="center"><h1><img src="images/stantonV2.jpg" width="100%" height="auto" alt="" title="" border="0"</h1>.......


If it's still displaying funny at certain screen sizes, you could try changing the width to 90% (for example) so it won't stretch to the full width of its available space.
You could also assign a class or ID to it – something like this:

h1 img {
max-width: 220px;
height: 250px;
}
(and remove the in-line width/height from the html code)

The picture is small enough that the width wouldn't be an issue even at the smaller screen sizes.
Just curious... why are the h1 and h2 within "<div align="center"></div>"? It seems the centering along with the float: left may be giving it the room to stretch out of proportion.

That's a nice use of that template – well done :)



I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 122279 Photo


Senior Advisor
14,571 posts
Online Now

Paintbrush, he hasn't applied Eric's suggestion yet. I tried his suggestion last night, and it worked well on my iphone.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 271657 Photo


Ambassador
3,816 posts

Just wanted to throw out some other info since I learned (through trial & error) that 100% width isn't always the answer – sometimes it's the problem :lol:
I've had a problem with some pics stretching vertically to fill empty space beneath them :o as well as the horizontal stretching. Most are OK with just width: 100%, height: auto – but it depends on what's holding the picture.
Sometimes 100% of the div space available is wider than the photo's original width so you get stretched distorted photos. For photos that start out at well under 320px wide (up to about 280px), I'd just leave them at their original size since there's no need to shrink them to fit.

(When I looked at Rich's photo without the float left, it didn't get distorted at all no matter the size.)
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 122279 Photo


Senior Advisor
14,571 posts
Online Now

You're probably right. I haven't yet had the time to delve into the fluid/responsive templates due to other commitments (we have 125 bee hives). But I will. :)
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 187934 Photo


Senior Advisor
20,247 posts

If the img 100% doesn't work with the current setup then all that should need to be done is set the image inside a div with a max width the same as the image.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

Inger – When it comes to responsive images, there's probably about as many ways to deal with them as you have bee hives! :lol:
I've just begun to play with one of the new CC templates ("birdie"), so will have to mess around some more to see how it goes. Maybe a cup of tea with HONEY before getting back to work... where did that thought come from? :D

How's it going, Rich?
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 187934 Photo


Senior Advisor
20,247 posts

All this Honey talk reminds me of something.:)
I eat my Peas with Honey, I've done it all my life, It makes the Peas taste funny, but it keeps them on the knife.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

I had a go at the template... this worked for the photo:

<h1><a href="index.html"><img src="stantonV2.jpg" width="100%" height="auto" alt="" title="" /></a></h1>


header h1 {
font-size: 1.8em;
float: none;
max-width: 220px;
height:auto;
padding-bottom: .5em;
}


(I didn't make any changes to the h2 or menu)

Eric :lol: Haven't heard that since I was a kid – sounds kind of yucky now
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.