472,951 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 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 2597
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: Mushico | last post by:
How to calculate date of retirement from date of birth
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.