Browser History – How to split up Chrome 22-28 with CSS Hacks (the best way so far…)

These are my legal CSS Hacks for fixing web browser quirks or outright bugs. Please enjoy, I have been working on them for years. May it help you if you need them. Please read here first: [What are these CSS Hacks Anyway?] Then check my [Live CSS Hacks Test Page] and also [BrowserHacks.com] where I sent new hacks and test submissions for the site.

With my Chrome 22-28 hack, what if you needed just one of these due to a difference in CSS? (This does happen, hence the need for browser version hacks of specific numbers.) Mostly this is just for interest in puzzle solving, but not recent. The main purpose being the attempt to target specific browsers if possible.

From my Chrome and Safari hacks page:

/* Chrome 22-28 (and Opera 14-15) */

@media screen and(-webkit-min-device-pixel-ratio:0) {
    .selector {-chrome-:only(;
        property:value;
    );}
}

Grabbing several from my Live CSS Hacks Test Page:

Do this one first to target Chrome 25 (The next couple will override 22-24):

/* Chrome 22-25 */

@media screen and(min--moz-device-pixel-ratio:0) {
    .selector {
        property:value;
    }
}

Now the overrides:

/* Chrome 22-23 */

@media screen and(-webkit-min-device-pixel-ratio:0) {
    _::-moz-svg-foreign-content, _:scope, .selector {
        property:value;
    }
}
/* Chrome 24 */

@media  screen and (orientation) {
     ::webkit, .selector {
        property:value;
    }
}
Advertisement

IT Director/Senior Software Engineer, Photographer I test and create new CSS web page formatting hacks for BrowserHacks.com for the purpose of repairing web sites. PS-- CSS hacks are fun, but please attempt good CSS first unless in a bind. See Test Pages: https://browserstrangeness.bitbucket.io and https://browserstrangeness.github.io

Tagged with: , , , , , ,
Posted in Chrome, Chrome-All, Computers, Cool Code, CSS, CSS Hacks, Hacks, Safari, Web, Web Browser, Web Browsers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: