Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resolution on web page

Status
Not open for further replies.

oaklanders

Technical User
Dec 9, 2007
38
I am trying to create a page where it will look the same if the screen is resolution 1024 x 768 or if the screen is resolution 800 x 600.

The below finds the resolution but the page looks different depending on the resolution. Please advise how I can make a web page look the same no matter what the resolution?

Code:
<script>
if ((screen.width>=1024) && (screen.height>=768)) 
{ 
divWidth = 1024;
divHeight = 768 ;
document.write("high res 1024");
} 
else 
{ 
divWidth = 1024;
divHeight = 768 ;
document.write("low res 800");
}
</script>
</head>

<body>
<table width=100%>
<tr>
<td><font size=+4>
long scroll test where the page will scroll wider depending on resolution.....
</font>
</td>
</tr>
</table>
</body>
</html>
 
oaklanders said:
Please advise how I can make a web page look the same no matter what the resolution?

There are two paths you can take (and I'm not sure whether by "look the same" you mean "scale to size" or "remain static"). One is to fix the width of the site to the smallest resolution that would be expected - see
The other is to use fluid measurements (percentages) to get your layout to scale to the size of the window - see
Either method is best achieved using CSS rather than script.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Webflo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top