Jump to content

problem expression max-width


arbitter

Recommended Posts

So, I have pictures I must give a max-width. But as all of you know, IE is a pain there.

So usually, I'd just use inline css by saying style='max-width:'50px'" or something. But I did some research, and then I had the following:

img.first {
		max-width:390px;
		/* IE Image max-width */
		width: expression(this.width > 390 ? 390: true);
		}

 

But according to the W3Schools validator , the "width > 390 ? 390: true);" isn't correct as the numbers are incorrect. I tried with 390px but that doesn't do it eather.

Could someone help please?

 

Link to comment
Share on other sites

Your declaration is fine. I believe your problem comes from the fact that the declaration is IE proprietary, and therefore not valid according to W3C. But if you want your max-width to work in IE6, you will have to include that.

Link to comment
Share on other sites

Then I'll just ignore it.

Thanks  a lot!

 

[ot]On a side note. The validator you keep referring too as being 'w3schools' is actually the w3c's validator. The w3c has nothing at all to do with w3schools.

[/ot]

Link to comment
Share on other sites

Then I'll just ignore it.

Thanks  a lot!

 

[ot]On a side note. The validator you keep referring too as being 'w3schools' is actually the w3c's validator. The w3c has nothing at all to do with w3schools.

[/ot]

 

Yes I know, but it only soaked into my brains after saying those things. My bad :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.