Posts Tagged ‘tip’

Image size trick in css

Posted in Miscellaneous on October 30th, 2009 by Thomas – Be the first to comment

In a css layout of a webpage where the whole site is created using em, images often ends up “destroying” the layout when a user increases or decreases the text-size. This can easily be fixed by a simple cms trick.

     <img class="list-image" src="/path-to-your-image.jpg" width="100" height="200" />

If you want the image to scale coherently to the em size, do the following:

. list-image {
      width: 10em !important;
      height: 20em !important;
}

Embedding Flash without messing up the HTML fall back

Posted in XHTML / JavaScript / CSS on April 1st, 2009 by Erland – Be the first to comment

Sometimes we need to insert a 100% Flash into a page. This little snippet shows you how you can achieve it without breaking the normal browser behavior (scrollbars etc) for users viewing the retro HTML fall back.

Prerequisites: jQuery and swfobject 2.

read more »