473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

CSS, Max-Width and skinny images in Safari (on Mac)

Stentorian
Hello,

I am having trouble with skinny images in Safari on a Mac (This works fine in Safari beta for windows!)

Basically I have set up a CSS class using 'max-width' to ensure that images do not expand beyond 100px. I have included the hack for IE. Works fine on a PC in IE, Firefox, Opera and Safari. But in Safari on a Mac the width is confined, but the image does not scale, the height remains the actually height of the image and so I get skinny images and crap layout.

I need to use the max width, as users will be uploading any old photos (you know what users are like) and I need to keep it within the design. I also cannot use max height, as some photos are landscape and others portrait.

I search for a hack but couldn't find any...any ideas?

Expand|Select|Wrap|Line Numbers
  1. .content_image {                        
  2.     max-width: 100px;
  3.     float: left;    
  4.     overflow: hidden;
  5.     margin-right: 10px;
  6.     margin-bottom: 10px;
  7.     border: 1px #175592 solid;
  8.     width:expression(this.offsetWidth>99?100:'');
  9. }
  10.  
Thanks.
Ben
Feb 29 '08 #1
2 2622
drhowarddrfine
7,435 Expert 4TB
I really need to get a Mac.

max-width, et al, works on Safari. Perhaps you can do:
.content_image img{ max-width:100px} and see what happens?
Feb 29 '08 #2
Thanks Dr.

Yes I know what you mean. Having a mac would be useful, but can't really bring myself to spend £1000 just for testing one browser!

I will try the 'img' definition and see what happens...

Cheers.
Ben
Mar 1 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: dumblede | last post by:
Hello fellows, i would like to center a 800px wide 600px high content area without using frames. I have "come up" with the following solution so far. It works under IE 6.0, Firefox 1 (under...
3
by: Marcia Gulesian | last post by:
The following code suppresses the 'enter' key, when run in I.E. 5.5 or later (Windows) but not when run in Safari (Mac) <body onkeypress="javascript:keysuppress(event)" > function...
2
by: Marcia Gulesian | last post by:
The following code suppresses the 'enter' key, when run in I.E. 5.5 or later (Windows) but not when run in Safari (Mac) <body onkeypress="javascript:keysuppress(event)" > function...
3
by: Marcia Gulesian | last post by:
The following code works in I.E. (PC) but not Safari (Mac) window.opener=self; window.close(); What code will close the page when it runs in Safari?
6
by: Giuseppe Chielli | last post by:
Hi! I'm new to this newsgroup. I have a problem: I need to get the window size via Javascript; I usually use window.innerWidth or document.body.clientWidth with IE and Firefox and it properly...
17
by: Navaidstech | last post by:
Hi all... I'm new to Java programming. I've seen how finicky java is as far case and space sensitivity sensitivity is concerned. However, I'm slowly getting hang of it. I came accross this...
0
by: mrlk | last post by:
ive tried setting the heights in the td its in, both as a style and fixed height, and in the css you can see it here (go to beaches section) (also is there anyway of fom styling on safari in a...
5
ctoz
by: ctoz | last post by:
Didn't think I'd ever need to serve CSS to Safari--but that's what I need: tried all sorts of compromises on styling, just about exhausted the possibilities there, won't bore you with 'em. ...
1
Dmitry Khudorozhkov
by: Dmitry Khudorozhkov | last post by:
Hi everyone! I have a html page with an IFrame; and the following code: var doc = document.getElementById("iframe_id").contentDocument; doc.body.innerHTML = htmlCode; This code is run in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.