I need help with a CSS script...

liunx

Guest
hi! :D i own an ezBoard, & i found this script i really wanna use at my board, but i can't figure out how to put the size in. (125) i don't know if anyone can help, but i've been helped before, so i figured it was worth a try. (this forum rocks!)

ok, here's what i found.......


Personal Icon Tamer (CSS)

<< updated: 6/26/2003

Summary: Turn off / resize extra-large personal icons.

Details:

In Netscape / Mozilla browsers, personal icons wider than the limit will be resized. In Internet Explorer, they will be hidden.

HEAD: (box #1)

<style type="text/css">

/* PERSONAL ICON TAMER */

span.title img { max-width: PERSONAL_ICON_MAX_WIDTH; }

span.title img { width: expression(this.width > PERSONAL_ICON_MAX_WIDTH ? this.style.display = "none" : "auto"); }

/* END PERSONAL ICON TAMER */

</style>

HEAD Notes:

Change each instance of the text PERSONAL_ICON_MAX_WIDTH to your maximum allowed personal icon width.



~ when i take out the PERSONAL_ICON_MAX thingy & replace it with 125, nothing happens. :confused: i tried "125" & 125px but they didn't work either.

thanks in advance!

luv, biffps....

i also have a few other CSS & javascripts in that box already. could they be messin it up? would they need to be in a certain order? :confused:Could you post a link to some code or post all the HTML, CSS and JavaScript?

Also, the CSS max-width: does not work at all in Internet Explorer. It only works in browsers that impliment CSS properly (i.e. Mozilla, Opera 7, Firebird, Safari).

I'm not familiar with CSS expressions, so basically that means few browsers have advanced enough support for CSS to use expressions.it figures. i thought it sounded too good to be true. when i posed my question at the board of the site where i found the script, nobody replied. :p they should just take it down then! :mad:


anyhoo, thanks for answering me! y'all are so helpful here! :DYou could still impliment that code, just look at the site using the latest Mozilla or Opera. It might work on those browswers.

Worse comes to worse, set the width of a table cell or div containing the image and set the overflow: property to auto. Then people could have larger images and the DIV that contains the image would contain scroll bars for images over a certain width and height.

Another option is to detect the image type and size with a server-side language like PHP. I know PHP has some pretty powerfull image editing functions. Nothing like Photoshop of course, but they will suffice for your purposes none-the-less.

I know that this forum doesn't allow you to upload icons greater than a certain width and height. They do that with PHP.

You could try popping this question in the PHP forum saying that you want to be able to detect the image type and dimensions so you can block certain image types and dimensions.
 
Back
Top