Solved

HTML Width does not match Screen Resolution

Posted on 2015-02-16
11
51 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40613289
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 5

Expert Comment

by:Jim Riddles
ID: 40614068
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
ID: 40615595
Please see attached: Chrome and Safari OK, but Firefox way out.

Any ideas?
FireFox.png
chrome.jpg
Safari.jpg
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 83

Expert Comment

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

Author Comment

by:APD_Toronto
ID: 40616948
still not working
0
 
LVL 5

Expert Comment

by:Jim Riddles
ID: 40617144
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 83

Expert Comment

by:Dave Baldwin
ID: 40617161
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
ID: 40617208
If you see, per this snapshot, I am at 100% I even re-installed Firefox. Maybe its my computer.
FF100.png
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40617235
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 5

Accepted Solution

by:
Jim Riddles earned 500 total points
ID: 40617346
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
ID: 40617440
This did the trick!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

735 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