How To Set A Maximum Width or Maximum Height For An Image With CSS

I was trying to figure out how to set the maximum width and maximum height for my images, and I wanted a way that didn’t require PHP programming. I finally found a way and stumbled upon how CSS could make use of expressions as well. It’s a method where you can have a conditional statement in CSS, as follows: #container img { max-width:500px; width: expression(this.width > 500 ? 500: true); max-height:300px; width: expression(this.height > 300 ? 300: true); } What

Continue Reading

PHP Code to Detect IE Browsers

The extremely buggy way that Internet Explorer renders CSS annoyed me again, this time because of the different way it displays elements with z-indexes. I spent a couple of hours trying to fix the bug, failed, and decided to go about it another way. The problem lay in a CSS/Javascript rotating banner gallery ,so I used PHP to redirect all Internet Explorer users to a static version of that instead. Here’s the PHP code that I used. This is the

Continue Reading

Site Footer

Sliding Sidebar


The contents on this blog are not intended as professional advice. The author disclaims any liability, loss, or risk taken by individuals who directly or indirectly act on the information contained on this blog.