WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > @media selectors for iPhone

Reply
  Thread Tools Display Modes
Old 1st September 10, 09:17 AM   #1
john love
WLC Member
 
Join Date: Dec 2006
Location: Upper Peninsula of Michigan
Posts: 46
Default @media selectors for iPhone

With respect to targeting iPhones, I understand <link ...> to access different .css style sheets.

My challenge is the proper use of @media selectors, such as:

Code:
@media max-device-width:480px {
#poemWrapper {
	text-align:     left;
	}
	
#poem {
	width:          auto;
	color:          #00f;     /* just for testing */
	}
}
This inline approach is not working for me.
john love is offline   Reply With Quote
Old 1st September 10, 12:30 PM   #2
rkrause
WLC Mod
 
Join Date: Sep 2009
Posts: 883
Default Re: @media selectors for iPhone

I would look at how you have those brackets wrapped.



Ryan.
rkrause is offline   Reply With Quote
Old 1st September 10, 04:36 PM   #3
john love
WLC Member
 
Join Date: Dec 2006
Location: Upper Peninsula of Michigan
Posts: 46
Default Re: @media selectors for iPhone [SOLVED]

brackets wrapped??

I substituted all for max-device-width:480px and it worked just dandy. So, I don't understand what you are getting at.

Nevertheless, I found the problem, though I definitely do not understand why it is a problem.

Instead of @media max-device-width:480px, I used:

@media screen and (orientation:portrait) This worked. I did not need changes for the landscape orientation.

Thanks.

John

P.S., here's the link for anyone with a iPhone handy. In the meantime, I used the testiphone and this web site.

Last edited by john love; 1st September 10 at 06:13 PM.
john love is offline   Reply With Quote
Old 3rd September 10, 12:13 PM   #4
john love
WLC Member
 
Join Date: Dec 2006
Location: Upper Peninsula of Michigan
Posts: 46
Default Re: @media selectors for iPhone

I'm beginning to think the so-called iPhone/any mobile emulators out there do not do their job accurately.

What is driving me nuts is that I do not own a smartphone and therefore I am forced to use these so-called emulators whose effectiveness I've come to doubt .. in short, do they accurately emulate.

In addition, these emulators do not handle re-direction.

Bottom line .. I guess I really don't know if:

@media only screen and (max-device-width:480px) and (orientation:portrait)

bombs on a real mobile phone .. it definitely does on 2 so-called iPhone emulators.

Many, many folk testify that the above @media works, but I just cannot confirm it.

John Love
john love is offline   Reply With Quote
Old 4th September 10, 10:07 AM   #5
chrishirst
Banned
 
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
Default Re: @media selectors for iPhone

Personally I do nothing "special" at all for mobile devices and don't have a problem.
I've tested the pages on various real phones (mine or friends and family).

I now simply use relative dimensions for everything and let the devices handle it.
chrishirst is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:18 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyright© 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.