Feeds:
Posts
Comments

Archive for the ‘CSS Hacks’ Category

As body:nth-of-type(1) and body:first-of-type are supported by FireFox 3.5x, the hack that I wrote about in this post cannot be used anymore. You may try the following one, which targets only Google Chrome and Safari:
@media screen and (-webkit-min-device-pixel-ratio:0)
{
 div
 {
  color: red; /* The text will appear red only in Safari and Google Chrome */
 }
}

Read Full Post »

Notwithstanding the improvements in the CSS support in Internet Explorer 8, there may be cases when a CSS hack for that particular browser is necessary. Here is one that works in IE8 Standards Compliance Mode:
.classnameOrElement
{
 color /*\**/: blue\9
}
And another one that will be applied in all IE versions:
.classnameOrElement
{
 color: blue\9
}

Read Full Post »

Here is a collection of 10 CSS tips, tricks in blogposts I have written during the last year that you may find useful:
01. Better Image Scaling and Resampling in Internet Explorer
02. Setting Opacity and Other Filters in Internet Explorer 8
03. The 32 External CSS Files Limitation of Internet Explorer and More
04. Unobtrusive CSS Loading Indicator for Images
05. CSS: Filtering and Distinguishing Google Chrome and Safari
06. [...]

Read Full Post »

Oddly enough, but the image scaling by using bicubic interpolation is turned off in Internet Explorer. All other browsers have this turned on by default, because this is the only normal and expected behavior. Due to this badly chosen default, sometimes the images in Internet Explorer are not displayed as smooth as in other browsers. To [...]

Read Full Post »

It was expected that Internet Explorer 8 will support the standard “opacity” property of CSS, but it seems that its developers have decided not drop the support for filters yet, which is not that bad, though, as it still lacks support for <canvas> scripting.
However, there is a great difference between the filter support in IE8 and its [...]

Read Full Post »

 As body:nth-of-type(1) and body:first-of-type are supported by FireFox 3.5x, the hack that I wrote about in this post cannot be used anymore. You may try the following one, which targets only Google Chrome and Safari.
Personally, I avoid using CSS hacks, and when writing client code I always assume that anything can be done the “legal” way.
However, [...]

Read Full Post »

The alpha transparency filter applied on parent elements is inherited by their children, which is not always the desired behavior and can create unwanted design effects.
However, due to a browser bug in Internet Explorer, there is a cool hack that allows not only to reset the alpha transparency of the parent element in its children, but also to control [...]

Read Full Post »

Fortunately, Internet Explorer 7 supports border-color: transparent, but still, there are hardcore IE6 users and it seems that they will never update their browsers.
This post is targetted to the developers that care and dare to make their websites crossbrowser.
Thanks to a less known Interner Explorer CSS filter, the transparent border in Internet Explorer 6 can [...]

Read Full Post »

Here is a less known and rather exotic CSS hack, visible for Internet Explorer based on a rendering bug. Unfortunately, it is visible both in versions 6 and 7, but still it can be useful as a last resort for styling.
And here it comes:
h1
{
 color: green;
.color: red;
}
Internet Explorer 6 and 7 will render <h1>…</h1> in red, while [...]

Read Full Post »