?
Solved

HTML Width does not match Screen Resolution

Posted on 2015-02-16
11
Medium Priority
?
55 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 7

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
Industry Leaders: 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 7

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 7

Accepted Solution

by:
Jim Riddles earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

777 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