Solved

HTML Width does not match Screen Resolution

Posted on 2015-02-16
11
47 Views
Last Modified: 2015-02-18
Hi Experts,

I am starting a web application that will have a lot of forms for user input, and I want to get the page width correct before I start placing controls. The controls placement is very important to user.

The lowest resolution that the user wants this application accessed from is 1440 x 900, so I put together the following templates, which show great in IE, Chrome and Safari, but in Firefox it runs off to the right.  All browsers are set to 100% view.

My html:
 <!DOCTYPE html>
<html lang="en">

 <head>
	<meta charset="utf-8">
        <title>$app_title</title>
	<link rel="stylesheet" href="../styles/main.css">
	
</head>
    
	<body>
            
                <h1>$app_title</h1><br>
                <h2>$page_title</h2>
            
            
            <!--Content Start-->
            
            <!--Content Finish-->
            
        </body>
 
 </html>

Open in new window


My CSS:
/* So the HTML5 structural tags work in older browsers */
article, aside, figure, footer, header, nav, section {
   display: block; 
}
/* the styles for the elements */
*{
	margin: 0;
	padding: 0;
}
html{
    background-color: gray;
}

body{
    font-family: Arial, Helvetica, sans-serif;
    font-size: 100%;
    width: 1300px;
    height: 600px;
    margin: 10px auto;
    border: 2px solid black;
    background-color: white;
    padding: 20px 10px;
}

 h1{
    color: red;
    font-size: 120%;
    text-align: center;
    
}

h2{
    color: blue;
    font-size: 100%;
    text-align: center;
}

Open in new window



Thank you
0
Comment
Question by:APD_Toronto
  • 4
  • 4
  • 3
11 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
I only have 1280x1024 on this computer but your code in Firefox shows a perfectly normal 1300x600 body.  It extends 20px off the page.
1300 x 600
0
 
LVL 4

Expert Comment

by:Jim Riddles
Comment Utility
I tested this on Firefox on Mac OS X 10.9.5 and it displays correctly.  Can you post a screen shot showing the difference between the browsers?
Screen-Shot-2015-02-17-at-8.11.58-AM.png
0
 

Author Comment

by:APD_Toronto
Comment Utility
Please see attached: Chrome and Safari OK, but Firefox way out.

Any ideas?
FireFox.png
chrome.jpg
Safari.jpg
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Press Ctl-0 (zero) in Firefox to rest the zoom to normal.
0
 

Author Comment

by:APD_Toronto
Comment Utility
still not working
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 4

Expert Comment

by:Jim Riddles
Comment Utility
APD,

Are you using a Windows or Macintosh machine?  On a Mac you would press CMD + 0 to view at 100%.  Open the menu at the top right and see what your zoom level is set at.  It should be 100%, but your screenshot does appear that it is higher than that.

If you look at my previous screenshot you will see that the site is displaying correctly per your CSS specifications.
Screen-Shot-2015-02-18-at-1.12.57-PM.png
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Last time we had a question like this, the Zoom in Firefox was not at 'normal'.  On my MacBook Pro with a 1440x900 screen, I get the same display in Firefox as you show for Chrome and Safari (which is also the same on my MacBook).

If you are on a Mac, press Cmd-0 (zero) in Firefox to reset the Zoom to 'normal'.  Or you can go to the View -> Zoom menu and click on it.
0
 

Author Comment

by:APD_Toronto
Comment Utility
If you see, per this snapshot, I am at 100% I even re-installed Firefox. Maybe its my computer.
FF100.png
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Even when you re-install Firefox, it does not normally change your preferences which is where the Zoom setting would be stored.  It's not your computer because the other browsers would have problems also.  But it is something about the way your Firefox is set up.  The rest of us see the same view in Firefox as we do in Chrome and Safari both on Macs and PCs.
0
 
LVL 4

Accepted Solution

by:
Jim Riddles earned 500 total points
Comment Utility
I agree with Dave...this is something related to your Firefox install.

Open Firefox and enter "about:config"
Search for "layout.css.devPixelsPerPx"
The value should be "-1".  If it is not, then change it to "-1" and restart FireFox and try again.
If the value is already "-1", change it to "1" and restart FireFox and try again.

Let me know if that helps.
0
 

Author Closing Comment

by:APD_Toronto
Comment Utility
This did the trick!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

10 Experts available now in Live!

Get 1:1 Help Now