Search code examples
htmlcssmobile-website

Mobile website, portrait to landscape


I'm making a mobile website, in portrait the nav bar is sized nicely with 15px of padding around the top and bottom, but when I switch to landscape mode, it takes up almost half the screen.

What is the best way to go about this so it's smaller?

A separate stylesheet or is there a trick I don't know about?


Solution

  • i use this for my client mobile site and its work correcly :

        <link rel="stylesheet" media="all and (orientation:portrait)" href="[css_file]">
        <link rel="stylesheet" media="all and (orientation:landscape)" href="[css_file]">
    

    the css file can be same