Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Dwayne Bensey
Jan 7, 2010
I'm trying to make my portfolio site responsive, particularly for my Galaxy S3 so I can show it to people at jobs fairs, etc. The problem is I can't seem to get my media queries to work properly across both the default Samsung browser and Chrome. Both of them give different values for device-width and device-height, so I've just been using width and dpi to adjust it for my phone.

Samsung browser:


Chrome:


(sorry for the large images)

I've tried the following:

code:
#container
{
	background-color: red;
	width: 50%;
	height: 50%;
}

@media screen and (max-width: 360px) and (-webkit-device-pixel-ratio: 2)
{ 
	#container
	{
		background-color: yellow;
		...
	}	
}
...but it still uses the color and dimensions from the first #container rule. Has anyone else had trouble with S3s? I've scoured Google and Stack Overflow, but none of the suggestions from other people seem to work :(
Am I missing something really obvious here?

edit: Never mind, it's working now! :)

In case anyone is interested:

code:
@media only screen and (max-device-width:720px) and (-webkit-min-device-pixel-ratio: 1.5)
{ 
	#container
	{
		background-color: yellow;
		...
	}	
}

Dwayne Bensey fucked around with this message at 22:44 on Oct 9, 2013

Adbot
ADBOT LOVES YOU

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply