Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1112351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:41:45+00:00 2026-05-17T02:41:45+00:00

my concern is that I have to build a website for mobile devices. In

  • 0

my concern is that I have to build a website for mobile devices. In the concept is an image set as header.

The problem is now: Different smartphones have different display resolutions.

There are e.g. 840×560, 480×320 or 800×480.

What do I have to write as meta-tags, css, etc. to fit the image in “every” modern smartphone to the display?

I hope my concern was clearly described.

Thanks, Chris

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:41:46+00:00Added an answer on May 17, 2026 at 2:41 am

    Because width: 100%; seems to be well supported I’d suggest either:

    #header {
        width: 100%;
        padding: 0;
        margin: 0;
    }
    #header img {
        width: 100%;
        padding: 0;
        border: 0;
        outline: 0;
    }
    
    
    <div id="header">
        <img src="header.png" />
    </div>
    

    or

    #header img {
        width: 100%;
        padding: 0;
        border: 0;
        outline: 0;
    }
    
    <img src="header.png" />
    

    setting just the width means that the image’s width/height ratio will be preserved by the browser. Bear in mind, though, that passing off image manipulation (the scaling/resizing) to the phone’s browser might result in less-than pretty artefacts being introduced.

    If you have the option of using different sizes of images, you can call those using @media queries:

    <link rel="stylesheet" href="mobileStylesheet1.css" media="only screen and (max-device width:840px)"/>
    <link rel="stylesheet" href="mobileStylesheet2.css" media="only screen and (max-device width:800px)"/>
    <link rel="stylesheet" href="mobileStylesheet3.css" media="only screen and (max-device width:480px)"/>
    

    And, in those stylesheets, defining:

    mobileStylesheet1.css

    #header {
    background: transparent url(path/to/840pxImage.png) 0 50% no-repeat;
    }
    

    mobileStylesheet2.css

    #header {
    background: transparent url(path/to/800pxImage.png) 0 50% no-repeat;
    }
    

    mobileStylesheet3.css

    #header {
    background: transparent url(path/to/480pxImage.png) 0 50% no-repeat;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good afternoon, I have three entities (that concern this question) Company (ID, etc..) CompanyAddress
I have to build an xml output that represents a data structured for a
I would like to have a CI build (e.g., Hudson) set up and tear
I have been building a website that should be launching in approximately 1 month
The apps that I build frequently have 'social media service' requirements; e.g. Twitter bit.ly
I have to build a program that will allow me to track from a
I am working on a website with heavy use of Ajax request that build
I'm developing a Web application that will let users upload images. My concern is
I am aiming to find out different security concerns that can occur on Android
This is regarding a project that concerns detection of text in an image using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.