SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    What a twist! Kings's Avatar
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    954
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using percentages or pixels?

    Which is better to use for the height, the width, the left and the top properties, percentages or pixels?

    At the moment I'm using percentages, and that seems to work fine, but maybe there's something I don't know.

    Thanks!
    Dennis Pallett - NoCertainty - My Personal Weblog
    The Web Network: ASPit | PHPit | WebDev-Articles
    Blogs: TalkFones | Holidayzer | PHPit Blog

  2. #2
    pie??? PIE!!!! rsdl's Avatar
    Join Date
    May 2001
    Location
    Vancouver, BC Canada
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd go with percentages. Percentages make your website more flexible in that people with various monitor resolutions can view your site optimally.

    Pixeled are ok assuming that you're using the 800x600 as your max limits.

    But i'd still go with percentages.

    -rsdl

  3. #3
    SitePoint Addict CeleronXL's Avatar
    Join Date
    Dec 2002
    Location
    United States of America
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Percentages, definitely.

    Unless there's some dire NEED to go pixels, then go percents.

    Percentages > pixels

  4. #4
    ********* Shroom mydster's Avatar
    Join Date
    Nov 2002
    Location
    tpyge
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    epends on the type of site.I prefer fixed widths most of the time...

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    Connecticut
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use percentages most of the time.. for the most part they're the best way to go, since even if you are on the same resolution, there's still many factors determining the size.. occasionally I use pt's if I want the table to specifically fit one line of text.. the only reason to use pixels is with a highly graphical layout..

  6. #6
    ********* Shroom mydster's Avatar
    Join Date
    Nov 2002
    Location
    tpyge
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I disagree Dan... I usually don't do high graphic design, and some stuff is fixed width...

    Also, for height, don't use percentages are opera sucks at displaying it.

  7. #7
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    Connecticut
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, it all depends. My one friend codes for 800x600 only, and the way his graphics are, he needs pixel values due to the slicing. The percentages are only good when you have something span the width of a table.

  8. #8
    SitePoint Evangelist S7even's Avatar
    Join Date
    Jun 2002
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use both. For example I would use a fixed width for the sidebar and a % width for the content area.

  9. #9
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also do a mix. Percentages for flexibility but pixels for elements that need to be fixed at a certain size. It's the best of both worlds IMO.

  10. #10
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hardly ever use percentages, other than 100%.

    Instead I set pixel-sized margins.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  11. #11
    What a twist! Kings's Avatar
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    954
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cyborg from dh
    I hardly ever use percentages, other than 100%.

    Instead I set pixel-sized margins.
    When you view your site at other resolutions, wouldn't it look absolutely crapped then? For example, if your site looks perfect at 800x600, wouldn't it then look too small at 1024x768?
    Dennis Pallett - NoCertainty - My Personal Weblog
    The Web Network: ASPit | PHPit | WebDev-Articles
    Blogs: TalkFones | Holidayzer | PHPit Blog

  12. #12
    SitePoint Enthusiast vischo's Avatar
    Join Date
    Mar 2003
    Location
    Chicago, IL
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Overall, percentages. However, I do use a 400px, or so, width on my main content; it increases readability as most people don't like to read long lines. But for layout percentages would work best.

  13. #13
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kings
    When you view your site at other resolutions, wouldn't it look absolutely crapped then? For example, if your site looks perfect at 800x600, wouldn't it then look too small at 1024x768?
    \

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    		<title>Demonstration</title>
    		<style type="text/css" media="screen">
    		body {
    		 margin:0px;
    		 padding:0px;
    		}
    		div#all {
    		 margin-left:90px;
    		 margin-right:90px;
    		 border-left:1px solid black;
    		 border-right:1px solid black;
    		 text-align:center;
    		}
    		</style>
    	</head>
    	<body>
    		<div id="all">
    			Hey all!
    		</div>
    	</body>
    </html>
    A dynamically-sizing page, using pixel-sized margins. The <div> is always exactly 90px from either side of the screen.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  14. #14
    SitePoint Member rotero's Avatar
    Join Date
    Mar 2003
    Location
    Philippines
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i preferably use percentage because of its flexibility, but also use pixel specially in formats,

  15. #15
    SitePoint Enthusiast abbey's Avatar
    Join Date
    Apr 2003
    Location
    Chicago
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depends on the content within the defined areas.
    <abbey />
    HTML/XHTML/CSS coding
    Abbey Ink


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
  •