Hello everyone, I have just been trying to get this done today as well. I want to serve 2 separate images one for HiDPI screens, and one for normal res screens. So far here is my solution, I want to server 2 separate images so I can minimize my bandwidth usage. Using css this is what I have came up with so far.
The only problem I have had is on my child pages this dies so I'm currently working on that now.
I use the following code to remove my logo.
#branding .mainlogo-img
{
display:none;
}
Then I take the following code and point it at my two images one larger rez and one lower rez. the one on top is standard res.
.mainlogo-link
{
width:662px;
height:100px;
background: url(../wp-content/uploads/2013/02/elimergel_logo_again.png) no-repeat;
}
@media only screen and (-webkit-min-device-pixel-ratio: 2)
{
.mainlogo-link {
background: url("../wp-content/uploads/2013/02/elimergel_logo_again-2x.png") no-repeat;
background-size: 662px 100px;
}
}
If you go to my site it seems to be working peachy keen until you browse to the Wedding page. I'm trying to figure out why that is and if I need to I thought I could just force it to work with the following code.
/*Replace logo Weddings*/
.page-id-431 #branding .mainlogo-img
{
display:none;
}
.page-id-431 .mainlogo-link
{
width:662px;
height:100px;
background: url(../wp-content/uploads/2013/02/elimergel_logo_again.png) no-repeat;
}
@media only screen and (-webkit-min-device-pixel-ratio: 2)
{
.page-id-431 .mainlogo-link {
background: url("../wp-content/uploads/2013/02/elimergel_logo_again-2x.png") no-repeat;
background-size: 662px 100px;
}
}
But alas no go. Ill keep hammering at it.
If you use the code on the top though you can serve two different images one for HiDPI screens one for regular old computer screens. If anyone can help me with my photography page let me know Ill be working on it till I get it fixed.