Solved

modify mobile site header image for portrait/landscape

Posted on 2013-12-03
3
328 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
ID: 39693636
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
ID: 39693831
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
ID: 39693873
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
webpage layout breaks when expanding bootstrap collapse component 8 26
Box Locations 6 16
Little bit of help styling my heading 3 21
Sort Order Icons on HTML Table 3 25
Are you having trouble connecting or getting your iPhone / Samsung device(s) to sync with Microsoft Exchange Server?   What have you tried?   What haven't you tried?
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
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 elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

832 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