SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get the page to stay proportial to browser window size

    Hello,

    How do webmasters get their layouts to stay proportional to the size of the browser window??

    When I visit some pages and decrease the size of the browser window I notice the layout readjusts its size and the content remains entirely in the browser window.

    When I visit other pages I note I get a scroll bar at the bottom of the page and I have to move the bar in order to see all the content (especially the content on the right) if I want to see and/or read it all.

    What code do I need to cause a web page layout to readjust to the size of the browser window??

    Thanks again folks for any help you can give me on this.

    BTW, I am reading Keven Yank's article on
    "Building a Database-Driven Web Site Using PHP and MySQL"
    http://www.WebmasterBase.com/article.php3?aid=228

    I am really getting into this stuff!

    WP

    Webbing Along!!!

  2. #2
    Destiny Manager Plebius's Avatar
    Join Date
    Nov 1999
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just use a percentage in your table width instead of pixels. eg <table width="90%"> instead of <table width="600"> then the table will take up x%


  3. #3
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Don't forget though that if you use percentages then your layout is going to appear very different in different monitor sizes. Whether if you use pixels it will always be the same!

  4. #4
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks LuZeR & Nicky,

    Appreciate the info.

    1. If I use percentages instead of pixels, will in tables also proprotion themselves to the bowser window size or do I need to add some code somewhere to get the images to change size as well???

    2. What changes on the page with changing resolutions if I use percentages, text?? images??

    Thanks again in advance for your responses.

    WP
    Webbing Along!!!

  5. #5
    Destiny Manager Plebius's Avatar
    Join Date
    Nov 1999
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1 - The pictures will change size if you set their width as a percentage as well.

    2 - Anything that has a % width or is in something with a % width

    I use percentages on my site.


  6. #6
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Nicky
    Don't forget though that if you use percentages then your layout is going to appear very different in different monitor sizes. Whether if you use pixels it will always be the same!
    Hi,

    I'll ask the question in a more specific manner. How different will the layout appear? What would be the negative(s) of using percentages? In other words, what things would look bad with using percentages??

    WP
    Webbing Along!!!

  7. #7
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by LuZeR
    1 - The pictures will change size if you set their width as a percentage as well.

    2 - Anything that has a % width or is in something with a % width

    I use percentages on my site.

    Hello,

    How would I adjust the percentage for an image? For example, if I say a table width is 50%, are all the images in the table 50% or do I divide the percentage by the number of images between <TR> tags. Lets say I had 2 images between <TR>tages (which mean I have two sets of <TD> tags) would each image have a 25% width or a 50% width?

    WP
    Webbing Along!!!

  8. #8
    Sports Publisher mjames's Avatar
    Join Date
    Jan 2000
    Location
    Charlotte, NC
    Posts
    5,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've always found that when you use percents instead of pixels or mix the two, it confuses Netscape and could cause errors. Pixels are good because it assures you the exact size you want in any browser or resolution, while percents are good because they work when you resize the browser window.

  9. #9
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I never use % for images, only for tables. I don't really see the use of using % for images either. For example, if you've designed a page for 800x600 and somebody views the page at a resolution higher than 1024x768, your images will look terrible jagged and ugly...

    Using % for the tables is good enough most of the time: the content resizes just fine...
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  10. #10
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Percentages for images would just be a bad idea in most cases. The WebTv browser resizes images, but other than that, with the occasional exception of images used for horizontal lines or shadows, you need to work around the size of your image. That's what makes percentages tricky. I use pixels for designs that are essentially centered and percentages when there's a navigation bar on the left and the page is left justified. So far that seems to have worked out ok.

  11. #11
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think percentages in images would almost ALWAYS be a bad idea...

    No, if you have a table with a width of 50%, the images inside will not also be 50%...just the table. If a table set to 50% is nested inside of another table that is 50%, then the table will only take up 25% of the entire screen...it's all relative.

  12. #12
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It is all relative, the best thing to do is to test test test in differnt resolutions and see which one would work best for you
    % or pixels


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •