?
Solved

Website design that dynamically fits page within destination browser

Posted on 2007-04-03
7
Medium Priority
?
244 Views
Last Modified: 2013-11-19
How can a website be designed so that pages automatically fit within the destination browser? Is it possible to programmatically detect the browser and screen resolution so that a page fits perfectly within a browser?
0
Comment
Question by:timonline
[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
  • 2
  • 2
7 Comments
 
LVL 5

Accepted Solution

by:
NickVd earned 1000 total points
ID: 18848816
Yes it is progammatically possible to detect sizes and whatnot, but it's not needed.

Simply design with percents and em's using css and you'll be fine. need a main container that is 90% and centered? with a minimum width of 770 and a maximum of 1000

<div id="maincontent">
lorem ipsum
</div>

#maincontent {
  width: 90%;
  min-width: 770px;
  max-width:1000px;
  margin:0 auto; /*center*/
  border:1px solid red;
}

The div will always take up either a minimum of 770, a maximum of 1000 or 90% of the width of the client window depending on how you set the rules up, you can make a site look perfect in almost any resolution.
0
 

Author Comment

by:timonline
ID: 18856410
NickVd, Thanks alot...
I am bit hazy on a couple of things, firstly what are "em's"?, secondly, what is "lorem ipsum" within the div tag?

With an existing site that has fixed width div tags, if I create a container (like in your example) and then make all existing div tags subordinate to this container, will the content in the existing div tags resize in the client browser according to the rules in the new container?
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 1000 total points
ID: 18876255
> with a minimum width of 770 and a maximum of 1000
and soon you break the rules :-/

Just use relative sizes in em or ex mainly, px just for borders. That's all and works since the beginning back in '93
0
 

Author Comment

by:timonline
ID: 19080551
ahoffmann, thanks...
forgive my ignorance, but could you tell me what "em" and "ex" refers to?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 19080594
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

649 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