Solved

modify mobile site header image for portrait/landscape

Posted on 2013-12-03
3
325 Views
Last Modified: 2013-12-06
Finally got the header image (logo) to work on my mobile site when phone is held portrait. BUT, when you turn phone to landscape, the ipad logo tries to load which is bigger than the mobile logo.  How do I manage this?  See screen shots from emulator (http://ipadpeek.com/)

http://nsitedesigns.com/nsitedesigns/wrb/index.html

landscape (http://m.soundcloud.com/)
http://nsitedesigns.com/nsitedesigns/wrb/index.html

portrait
http://screencast.com/t/ZlWRiF6aqVmy

Ipad
http://screencast.com/t/1Y6kF7p9ze
0
Comment
Question by:nsitedesigns
  • 2
3 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
You should be able to force it by specifying the orientation in a media query:

handheld and (orientation: landscape)

Should target phones in landscape mode.  So try adding it to the phone media query.

Cd&
0
 

Author Comment

by:nsitedesigns
Comment Utility
Could you give me a little guidance.  I am not sure how to write that css to target the various orientations. I found this online but am not sure what info I need to put in.  Do I include the "@media" in the css for the mobile css or for all?

@media all and (orientation:portrait) {
/* Style adjustments for portrait mode goes here */
}

@media all and (orientation:landscape) {
  /* Style adjustments for landscape mode goes here */
}
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
Comment Utility
Well you need to use screen or it won't get picked up by iphone and several others.

There is a specification for @media handheld and @media mobile in the standards but Apple chose to ignore them and present iphone as screen.  Stupid? Yes, but standards and browsers for mobile are about where desktop browsers were ten years ago.

You will need to be careful with resolution specifications as well because a lot of the newer android phones have resolutions up to 800+

Cd&
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now