Mobile CSS

iphoneSurprised that my websites looked rather good on an iPhone 4, I took a closer look at them on the second hand mobile device my wife has (I don’t endorse Apple Corporation until I see solid proof of it being anything else than a capitalist enterprise with the compulsion of endless expansion).

Sorry to bother you with a political sneer, but hey, this is the Geek Connection, we are more than just computer nerds.

So here is the line of code you can add to your stylesheet:

/* Mobile */
@media screen and (max-device-width: 1000px) {
/* Your CSS here, for example */
#content {
margin : 0;
padding : 0;
}
}

Works brilliantly on my German blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.