Solved

Website design that dynamically fits page within destination browser

Posted on 2007-04-03
7
237 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 250 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 250 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

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

739 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