Solved

Website design that dynamically fits page within destination browser

Posted on 2007-04-03
7
231 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
HOW TO REMOTELY CLEAN MEROND.O WITH ESET SILENTLY PROBLEM       If you have the fortunate luck to contract the Merond.O virus on your network, it can be quite troublesome to remove as it propagates to network shares on your network. In my case, the …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now